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

Printing a preview report from a form 1

Status
Not open for further replies.

jdonaway

Programmer
Jun 7, 2001
11
0
0
US
Hello all! I have a database in which my query is working fine, and when I run the individual report, that works fine. It runs the query, and displays the correct results. What I want the end result to be, is the user inputs their information into a form (which I've already created, then clicks the button at the bottom, and it runs the preview report with the results. I'm not sure how to do this and haven't been able to get this to work. Any help would be appreciated! Thank you, jdonaway@klmicrowave.com
 
Have you created a report yet? If not, then create a report based on the query. Then use the command button wizard to create a button on the form that previews the report that you created. This is very easily done using the command button wizard.
Sera
 
Hi, that's exactly what I did, but I get an error message when I click on the command button,something about the event procedure, an ambiguous name?? I used the wizard, so I don't understand why it isn't working. :-(
 
ok, I think I figured that out, I had created the button multiple times, so I started from scratch and deleted that code. But now I get an error message that says "The expression On Click you entered as the event property setting produced the following error: Invalid outside procedure. *The expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure]
*There may have been an error evaluating the function event, or macro.X-)
 
It is possible that you need to save the record before you try to preview the report...in the on click event of the button that previews the report put this line of code

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
right before this line of code(this line is generated by the wizard)
DoCmd.OpenReport stDocName, acPreview

this will force the record to save before you try to preview the record.
Sera
 
Hi, I tried that and I still get the same message. :-(
 
Is the database something that you could send to me and I will look at it.
whitse@inel.gov
Sera
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top