How do I code a button so I can print multiple types of reports all on a specific day?
I found a code to print only current report from a form screen, but I tried to modify it to work with what I want but I can't get it to go. Please Help!
if you are generating one report, probably the easiest thing to do is in your query, withing the date field criteria enter...
[Enter Date]
this will cause Access to prompt the user for a date.
if you wanted to pull you report based on a date range you would enter in your criteria...
Between [Begin Date] and [End Date]
this will cause Access to prompt the user for a begin date and then an end date.
if you are generating multiple reports based on the same date specs rather than having the user retype the date specs over and over, try this...
create a form (if you don't have one already)
put an unbound text box (i.e. combo, list) on your form
within each of the queries that generate your reports, include this field name as your criteria for the date field.
for example, in the query criteria, type....
Forms!Formname!Fieldname.value
(a more practical example might look like this....
Forms!Form1!date.value)
if you wanted to pull a certain date range you would enter
in the criteria section....
Between Forms!Formname!BeginDate.value and Forms!Formname!EndDate.value
for this example, you would need to create a field on your form for both begin date and end date. make sure you use the same field names, and that you specify the same form name in your criteria as you do on your form. for example, don't call the field on the form BeginDate and then in the query criteria call it StartDate.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.