Report Preview Command Button

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form with a comman d button attached. The button has the follwoing
code in the On Click event.

If Me.Dirty Then
Me.Dirty = False
End If
DoCmd.OpenReport "Invoice Details", , , "[InvoiceID] = " & Me!InvoiceID

The code should Open/Preview the selected report, instead it prints the
report. This is good as it would be the next Command Butoon I was going to
attache to the form, but I still cant preview the report. Any suggestions


Cheers

Steve
 
Try...

DoCmd.OpenReport "Invoice Details", acViewPreview, , "[InvoiceID] = " & Me!InvoiceID
 
Brilliant thank you so much

Rick B said:
Try...

DoCmd.OpenReport "Invoice Details", acViewPreview, , "[InvoiceID] = " & Me!InvoiceID


--
Rick B



Steve Moss said:
I have a form with a comman d button attached. The button has the follwoing
code in the On Click event.

If Me.Dirty Then
Me.Dirty = False
End If
DoCmd.OpenReport "Invoice Details", , , "[InvoiceID] = " & Me!InvoiceID

The code should Open/Preview the selected report, instead it prints the
report. This is good as it would be the next Command Butoon I was going to
attache to the form, but I still cant preview the report. Any suggestions


Cheers

Steve
 
Back
Top