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

Report Record Selection 1

Status
Not open for further replies.

Grumm

Technical User
Sep 27, 2002
68
AU
Hi, I have a form which is used to record and calculate project costs for each project. These tables hold information on many projects. At the bottom of the form I have a commant button that runs a report. The ptonlem I have is the report shows all projects but I only want the project on the form to be printed.

I am sure I am doing somthing silly.
 
Hi

Assuming unique id of Project is held in a control on the form called ProjectId, then in the DoCmd which invokes the report put:

DoCmd.OpenReport stDocName, acPreview,,"ProjectId = '" & Me.ProjectId & "'"

Assuming ProjectId is a string, if it is a numeric, then you can drop the '

Note if the form is also used to update the Project details, it would be wise to check if the form has been updated, and save the information before calling the report, eg

If Me.Dirty then
docmd.runcommand accmdsaverecord
End If Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top