I am a VERY new user to Access and have a purchase orderform with subform that I want to print. When I add a print form button, i get the entire data base print.
On the side of the main form you should see a record selector. Select the record you want and go file > print then select the option for selected records.
For future refrence, I don't print Fomrs, I only print reports. You may consider creating a report for the one you want, then printing from there.
To print one Purchase order you would add a selection criteria (where condition) to the OpenReport statement. For example, say PONO is a unique value in your table. The On Click event of the Print command would have this code. The portion of stLinkCriteria that is in quotes is the field in your table. Of course if it's a text field you would have to adjust the quotes.
Dim stFormName as string
Dim stLinkCriteria as string
I have tried this your code, but still prints all report pages when selected the current "[PONO]". On other selections, just for a blank report, no data.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.