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

Run a report from a form based on the current record

Status
Not open for further replies.

julie67

Technical User
Mar 1, 2005
24
US
How do I run a report, for example to show the attendees for a particular event that I have selected in the form? I want to add a parameter query to select that particular event and run the report based on that parameter all in one shot.

any suggestions?

thanks,
Julie
 
I need a little more guidance. Should I build the report off of the original query and not put in a parameter requirement? Where on the command button do I insert this code? I also do not understand this code.

It is important to use the current record since the user could type in the event description incorrectly and would not get any results in the report.

thanks,
Julie
 
I added the code in the event procedure for the command button, but it is not working....obviously I'm not much of a VBA programmer...any help would be great...thanks,julie
 
I think I figured it out...I forgot to add the strWhere in the part of the code:

DoCmd.OpenReport strDocName, acPreview, , strWhere

It seems to be working...thanks for the help

Jules
 
This faq faq181-2886 on how to get the most out of the membership, tells a little about what is often needed to be of assistance (#14) - current code, where is it placed, what errormessage if any, what are the control and field names involved... "but it is not working" doesn't give much to work ong\.

Roy-Vidar
 
Thanks for the tip, however I figured it out by reading the link to the code you provided.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top