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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling up a report with a parameter. 2

Status
Not open for further replies.

kingz2000

Programmer
May 28, 2002
304
DE
Hi Guys,

can someone please give me a hint on how to simply call up a report from a form button, with the addition of a date, as a parameter,which is on a textfield to filter the query?!! Thanks a lot in advance.
 
kingz2000
On your form, put an unbound control. Let's call it txtDateSelect.

In your query that populates the report, in your Date column, put as criteria...
Forms!YourFormName!txtDateSelect


Tom
 
It doesn't work-I must be doing something wrong!

I have on my form a txtdate which has the required date needed to be passed on to the report datasource.

Now, my query is on the report data source, which is probably a bad idea.How can I insert in as code??

At the moment my callreport_proc reads simply :
DoCmd.OpenReport "Op_Report_1", acPreview

Please help.
Thanks in advance
 
kingz2000
I am assuming you are doing it this way...

1. Your query is based on a table, which has a date field.
2. Your report is based on that query.
3. Your form has the unbound text box in which you put the date you want the report for...and your form has the command button (your command button expression is correct)

If these 3 assumptions are correct, then what I suggested should work.

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top