Can't get requery to work

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

Guest

I need the query that my form is based on to requery once the new data is
saved. below is what I've tried (see DoCmd.Requery qryVisitList).

Any help would be much appreciated.
Thanks, RobUCSD

Private Sub cboSaveVisitRecord_Click()
On Error GoTo Err_cboSaveVisitRecord_Click


DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.Requery qryVisitList

Exit_cboSaveVisitRecord_Click:
Exit Sub

Err_cboSaveVisitRecord_Click:
MsgBox Err.Description
Resume Exit_cboSaveVisitRecord_Click

End Sub
 
thanks for your response. i've tried that. I have a lsitbox on the form that
I need updated when the visit record saves. It is also based on qryVisitList.
I thought requerying the qryVisitList would also cause the listbox to update.
Any Ideas?
Thanks,
RobUCSD
 
Sorry - I was thinking the query was the form's RecorsSource. Use this line
of code (change ListBoxName to the real name of the listbox):

Me.ListBoxName.Requery
 
Back
Top