Print Command Button

cross5900

Blarg!
Local time
Today, 16:04
Joined
Mar 24, 2006
Messages
92
I am having a minor headache with a situation, I have a command button that opens a view of the report that will be printed. The problem is if someone creates a new record and hits the button it comes up blank.

If I add me.requery before the DoCmd statement then it just restarts to the very first record and shows that in the report view =(

Any Ideas? Thanks Guys!!

Code:
Private Sub PrintForm_cmdbutton_Click()
On Error GoTo Err_PrintForm_cmdbutton_Click

    Stop
    DoCmd.OpenReport "Main_frm Report", acViewPreview, , "ID Like '*" & Me.ID & "'"
    
Exit_PrintForm_cmdbutton_Click:
    Exit Sub

Err_PrintForm_cmdbutton_Click:
    MsgBox Err.Description
    Resume Exit_PrintForm_cmdbutton_Click
    
End Sub
 
Add If Me.Dirty Then Me.Dirty = False before you open the report. It saves the current record if needed.
 
You rock! Thanks.
 

Users who are viewing this thread

Back
Top Bottom