Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Requery a List Box

Status
Not open for further replies.

jdgreen

Technical User
Mar 21, 2001
144
US
I have list box on a form that is used as an index. When the user selects a work order number from the list, that work order is displayed. I have tried to set it up so the list box is updated when a new work order is added. What happens is the the work order does not show up until after a second work order is entered, so there is a lag in the updating. The code for pulling up the record from the list box is:

Sub List78_AfterUpdate()
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[WorkOrder] = " & Me![List78]
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub

And the code I'm using to update the list is:

Private Sub PlantNumber_AfterUpdate()
DoCmd.Save acForm, "frmAlertForm"
Me.List78.Requery
End Sub

I tried saving the form just to see if it would work, I got the same result.
 
Thanks. Don't know why I didn't think of that. Worked like a charm.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top