By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,490 Members | 897 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,490 IT Pros & Developers. It's quick & easy.

Problem with Report Generation

manoj9849967222
P: 48
Hi All

I have a form which has two text box to enter dates & a command button
now when i click the command button it runs a query and provides me the data between two given dates in the textbox.

Now i have a report based on query.

what i want to do is to have a command button on the form, which when clicked should generate a report between two given dates in the textbox.

Please help

Regards
Manoj
Sep 9 '07 #1
Share this Question
Share on Google+
1 Reply


MMcCarthy
Expert Mod 10K+
P: 14,534
Hi Manoj

You can add criteria to the Open Report command the same way as you would with the Open Form command. Have a look at the following ...

Expand|Select|Wrap|Line Numbers
  1. Dim stDocName
  2. Dim stLinkCriteria
  3.  
  4.     stDocName = "Report Name"
  5.     stLinkCriteria = "[DateField] BETWEEN #" & Me!DateFrom & "# AND #" & Me!DateTo & "#"
  6.  
  7.     DoCmd.OpenReport stDocName, , , stLinkCriteria
  8.  
Sep 9 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.