Only previewing current invoice

G

Guest

I have created a button to preview an invoice.
The code is below.
What do I add in so that it only shows the current record
and not the whole database?

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord,
acMenuVer70
DoCmd.OpenReport "Invoice", acPreview
 
G

Gary Miller

You need to use the 'Where' clause of the OpenReport method
and refer to that record's ID. Also, here is a simpler way
to force the save of the record as well...

Me.Dirty = False
DoCmd.OpenReport "Invoice", acPreview,,"[ID] = " Me![ID]

Substitute your Field name.
--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top