Full Version: Using specific record to fill out Report
UtterAccess Discussion Forums > Microsoft® Access > Access Reports
jlacharite
I have a simple question, how do you specify which record to use to fill out a report. Example, I have 500 records, I want to use record #300's info to fill in a report, how do you tell the report to use #300's info using code? any help is appreciated. Thanks in advance.

Jesse
erwardell
In the docmd.OpenReport you can indicate what you want the report to filter to. In the example I have it showing me all that have the field OBS that are true. You will have to change it so that it would use your field that you want to be filtered.



DoCmd.OpenReport stDocName, acViewPreview, , "OBS = True"

DoCmd.OpenReport stDocName, acViewPreview, , "EmpID = " & me.EmpID
This one would take the value from the form text box called EmpID.
jlacharite
Thanks a lot frown.gif, that is the key I have been searching for, once again you guys rule. Have a great one frown.gif
erwardell
You are welcome.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.