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

Using a Form to generate a query based report

Status
Not open for further replies.

purplebroom

IS-IT--Management
Jul 12, 2000
23
GB
I have developed a small access application to record the results of data backup jobs.&nbsp;&nbsp;I would like to automate the process used to generate a report for a given timescale, ie between specific dates.&nbsp;&nbsp;I had previously done this by using a query as the record source for the report and entering &quot;BETWEEN [Please Enter Start Date] AND [Please Enter End Date]&quot; in the criteria field of the query.&nbsp;&nbsp;This worked effectively but looks ugly because it just brings up the message in the form of a VB Prompt and I would like to modify how it looks.<br><br>So far I have managed to design a form with a text box titled start, the forms record source is linked to the table where all the data is kept.&nbsp;&nbsp;On the form is a button linked to a macro which opens the report.&nbsp;&nbsp;The reports record source is the query which I have now modified the criteria to read &quot;BETWEEN forms![formname]![start] AND =NOW()&quot;.<br><br>When I run this it opens the right report but with no data in it, I suspect it`s not picking up the data from the form, but I am well and truly stumped.<br><br>Any suggestions gratefully recieved<br><br>rgds<br>purplebroom
 
I have had similar problems.&nbsp;&nbsp;Are you keeping the form open when the report opens?&nbsp;&nbsp;You can make it not visible, but you can't close it.<br><br>Did you use the expression builder in the query to build your reference to the form's textbox?&nbsp;&nbsp;I don't know why, but that seems to work better sometimes (probably because it avoids those typos that we just don't catch)<br><br>Try putting a debug.print command in the report's Open event (or maybe the Load event)&nbsp;&nbsp;Something like:<br><br>Debug.Print forms![formname]![start] <br>Stop<br><br>The Stop command will put you into debug mode.&nbsp;&nbsp;Look at the debug window to see what was printed for the value for forms![formname]![start] <br><br>Let me know if you need more.<br><br>Kathryn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top