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

between in a report

Status
Not open for further replies.

Smarty

Programmer
Apr 12, 2001
191
BE
I have a form with a combobox and to textfields on it. They are used when i'm opening a report (by pressing a button on that form).
In the report i only want the records of the contact selected in the combobox and this works with a filterstring, but i only want the records for that contact between the date in the cFROM and the cTILL textfield. How do i add this restriction (in the filterstring or in a wherestring and how?)

Thanx

Maarten
 
Place the criteria of the date field in your query that feeds the report. The code looks like this:

Between Forms!MyFormName!cFrom and Forms!MyFormName!C=cTill

HTH Joe Miller
joe.miller@flotech.net
 
Thanx for your reply, but is it possible not to do this in the query, but in the form because i need this query also for other things and in the future i need to combine the where clause programatically...
in the openReport thing there is place for a where clause and a filter clause, but how do i do it there??

thanx again,

Maarten
 
You can do it when you call the form rather than doing in the OnOpen of the report, you should investigate the LinkCriteria of the DoCmd.OpenReport function. Help gives a thorough explanation of how to use it (very similar to where statements in SQL View).

HTH Joe Miller
joe.miller@flotech.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top