Click to See Complete Forum and Search --> : Access Question
kertsman
Jun 8th, 2000, 04:20 AM
This is more of an Access question then VB, but I need it for a program that might get used with VB. Anyway, I need to know how to put a value onto a report that the user will enter from a popup input box. When a query is run and in the Criteria box you put in a question, exp. [Enter Start Date]. How do I capture that value and put it onto a report.
Thanks for any help and if I was not clear enough let me know.
Kevin
Instead of using [Enter start date], create a custom dialog box. Let say creating a form named "frmDate", you will then insert [Forms]![frmDate]![txtStartDate] in the criteria. In the design view of the report, create a bound textbox that refers to the frmDate!txtStartDate control. Hope this helps.
Gary.Lowe
Jun 8th, 2000, 04:46 PM
Kertsman
This should be a little easier
I assmue on the form with the text box there is a button that executes the report. All you should have to do is as follows:
[code]
Dim sSQL as String
sSQL = "[DateField in Report]=" & [Forms]![frmDate]![txtStartDate]
DoCmd.OpenReport "Your Report", acViewNormal, ,sSQL
[\code]
The sSQL at the end of the openreport method creates a where statement when you open it.
Gazza :cool:
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.