G
Guest
I have a button on my form that prints information from the current record of
the form I am viewing. It only works if I close the form and reopen it after
entering the data. I added a Requery command to the first line of code on
the button but it ended up taking me back to the first record and then
printing what was on the first record.
This is my button code.
Private Sub PrintFileLabel_Click()
On Error GoTo Err_PrintFileLabel_Click
Dim stDocName As String
DoCmd.OpenReport "File Label", acViewNormal, , "[Project #] = '" &
[Project #] & "'"
Exit_PrintFileLabel_Click:
Exit Sub
Err_PrintFileLabel_Click:
MsgBox Err.Description
Resume Exit_PrintFileLabel_Click
End Sub
Could anyone tell me what I'm doing wrong?
the form I am viewing. It only works if I close the form and reopen it after
entering the data. I added a Requery command to the first line of code on
the button but it ended up taking me back to the first record and then
printing what was on the first record.
This is my button code.
Private Sub PrintFileLabel_Click()
On Error GoTo Err_PrintFileLabel_Click
Dim stDocName As String
DoCmd.OpenReport "File Label", acViewNormal, , "[Project #] = '" &
[Project #] & "'"
Exit_PrintFileLabel_Click:
Exit Sub
Err_PrintFileLabel_Click:
MsgBox Err.Description
Resume Exit_PrintFileLabel_Click
End Sub
Could anyone tell me what I'm doing wrong?