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

Problem with Report Generation

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

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

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
  4.     stDocName = "Report Name"
  5.     stLinkCriteria = "[DateField] BETWEEN #" & Me!DateFrom & "# AND #" & Me!DateTo & "#"
  7.     DoCmd.OpenReport stDocName, , , stLinkCriteria
Sep 9 '07 #2

Post your reply

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