Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looking at a row of data before printing

Status
Not open for further replies.

slud

MIS
Jan 12, 2004
8
US
I'm new to Access, but not new to s/w development. I'm using Access 97, but with some documentation of an earlier version, so I'm not sure what I can or can't do about my task.

I need to process the records from my query, and sometimes print two on one sheet/report, and sometimes not, depending on the value of one of the selected fields. So what I need is the ability to "look ahead" and maybe print on a sheet or not, depending on this value.

I saw in the manual I have something called "FindNext" et al. Will that help in what I need to do?

Any/all help is appreciated. Thanks.
 
do you still need help with this? if so, is the value you're looking at something that you can automate? so instead of YOU looking at it, Access does the work for you? i.e.

iif(Blah is True, Print, Dont Print)

??
 
To GingerR, the answer is Yes, I still need assistance. And yes to the question of automating this. I definitely would like the complete report to self-generate.
 
can you give more information then? what field are you manually looking at to make your decision? how do youcurrently have this set up?is it printing correctly for you but just taking you more time? I'm not very clear on how you currently have the report generating and printing right now. what have you tried so far?
 
Ginger, the db is relatively simple--3 tables, one dealing with plan data, one with personnel data, and one with company information. The actual sql query is as follows:

SELECT ExEmployees.PlanName, ExEmployees.EmployeeLastName AS Expr1, ExEmployees.EmployeeFirstName AS Expr2, ExEmployees.Address1, ExEmployees.Address2, ExEmployees.City, ExEmployees.State, ExEmployees.Zip, ExEmployees.SocialSecurityNum, ExEmployees.GrossDist, ExEmployees.TaxableAmt, ExEmployees.FedIncomeTaxWthdl AS FedTaxWthld, Plans.TrustIDNumber, ExEmployees.TotalDist, ExEmployees.DistCode, ExEmployees.IRA, ExEmployees.StateTaxWthhld AS StateTaxWthld, ExEmployees.PrctngOfDist, ExEmployees.EmplContr, Company.CompanyAddress, Company.CompanyAddress2, Company.CompanyCity, Company.CompanyState, Company.CompanyZip
FROM Company INNER JOIN (ExEmployees INNER JOIN Plans ON ExEmployees.PlanName = Plans.PlanName) ON Company.CompanyName = Plans.CompanyName
ORDER BY ExEmployees.PlanName, ExEmployees.EmployeeLastName
WITH OWNERACCESS OPTION;

As you can see the sorting is first by PlanName, and it's this where I'd like to make the determination of issuing the page break. Reiterating my problem, I'd like to print 2 successive records on one sheet as long as the PlanName is the same, but when the next record is for a different plan, then that one will print on the next form/sheet.

Thanks again for your interest/help.
 
in your report you can sort by Plan Name, make a header for it (SORTING AND GROUPING) then set the header property of FORCE NEW PAGE to "AFTER". Have you made reports before? You can use the WIZARD and it will walk you thru it.
 
Thanks Ginger. My report already has the features you suggested. But what is NOT there is the ability for 2 successive records for the same plan to print on one sheet--one at the top of the sheet and one at the bottom.
 
Ginger, The report already has a header, I didn't need to create one. Within the report header the Sorting and Grouping property says to sort/group by PlanName, ascending. I think that's there because of the sql statement saying "ORDER BY ....". Right? Is there something more needed? What I'm seeing on the report is the same record repeated at the top and the bottom. I don't know how to make access put the 1st record of a plan at the top and the 2nd at the bottom. Thanks.
 
there are a coupla things you can do.
first is to leave the query as it is, go into SORTING AND GROUPING, put Plan Name in there and down below in the SORTING AND GROUPING screen, choose HEADER = YES. it will create a header for you for your PLAN NAME. you can then put the PLAN NAME field in the PLAN NAME header area, and the rest of the text boxes in the detail section. then set the property FORCE NEW PAGE of the PLAN NAME header to be After Section (i think - sorry i don't have Access on this machine--on vacation--to check it). (right-click on the grey bar that indicates the Plan Name HEADER and choose PROPERTIES, find FORCE NEW PAGE and play with that. So what you might want to do is make the PLAN NAME text box bold and a little bigger, then the details normal font, something like that. hope this helps. let me know if i'm far off base....

g
 
G, Your suggestion has made a change--the report now produces a definite break between plan names. A new page is developed when the plan name changes. This seems to be good, but without the other part of the problem, I can't really tell.

I still need the ability to print 2 consecutive records for the same plan on one sheet. Then assuming the case of an odd number of records for one plan, the odd one should print at the top, with the bottom section blank. Possible?

S
 
How tall is your DETAIL section in design view? is it half the height of your paper? it should be. also (sorry i'm visiting my dad's in florida so i don't have Access to play with) i think in the case if you have more than one page for the same plan, there is a property of the Plan Header that is Repeat Section or something like that, in case the PLAN doesn't show up on the top of the second page.
 
G: The page is indeed about half a sheet long so that 2 records fit within the space.

When I tried setting the Repeat Section to 'yes', and I (accidentally) clicked to go to the last page (of preview), the program went into some non-responding loop, so that I had to abort it. Later when I reset this value back to 'no', it functioned as it did before.

S.
 
hi there--i'm on vacation at my dad's in florida right now, and don't have Access to goof around with. Maybe you want to write a new post to see if someone else can help out (reference this post so you don't have to re-type everything). Doesn't seem like it's a difficult thing but at this point i'd usually just get you to send me your db and I'd take a look. So try re-posting, and when I get back to seattle monday I'll check and make sure you got your problem fixed. sorry about that--g
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top