Requery Form

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
Before running the report you can try

Me.Refresh
Or
If Me.Dirty then Me.Dirty = False
Or
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
 
Back
Top