Only previewing current invoice

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
________________________
 
Back
Top