Display background image via mesagebox

John thomas

Registered User.
Local time
Today, 00:21
Joined
Sep 4, 2012
Messages
206
Hi
I have a report which is an invoice
I have a button on the report to reprint It .
Now if this is a duplicate Invoice I need to add a background Image ,something like a duplicate stamp .
I have added a message box
which says" is this a Duplicate Invoice" .If the answer is yes then I want to display the backgrond image and print the report .If the answer is no, then print report without background image
 
I'm assuming you know how to place the image in the background, so the following code should work. You will need to change the names of the controls to match your report:
Code:
Private Sub cmdPrint_Click()
Dim strDup As String

If MsgBox("Is this a duplicate?", vbYesNo, "Duplicate") = vbYes Then strDup = "Duplicate"

DoCmd.OpenReport "MyReport", , , Me.Filter, , strDup
End Sub

Private Sub Form_Load()
    Me.DuplicateImage.Visible = Me.OpenArgs = "Duplicate"
End Sub
 
Hi Many thanks for your help
I am new to code
Could you explain to me how this code works
I dont see how it prints the report .but a step by step description of the code would be very helpfull
Kind regards john
 

Users who are viewing this thread

Back
Top Bottom