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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refreshing data in a form's combobox

Status
Not open for further replies.

corbitt

MIS
Feb 22, 2002
73
US
I need help please!

We are using a simple Access DB to track user accounts. On our form, we have a combobox with a query as its row source. It is a combination of lastname & firstname linked to a unique PersonCompID. When we add a new user, the data in the combobox does not refresh. We have to close the DB, & reopen so the data (lastname, firstname) will appear. One website recommended using .requery, so I tried adding Me.RecordsetClone.Requery in OnClick & AfterUpdate. These did not work.

Any help is appreciated. (My code is listed below.)

Jeremy

Sub Combo43_AfterUpdate()
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[PersonCompID] = " & Me![Combo43]
Me.Bookmark = Me.RecordsetClone.Bookmark
Combo43.Value = ""
End Sub
 
its more like

combo43.requery

its the query in the combobox you want to requery not the recordset of the form
 
I'm trying that, I'll post the results.

Thanks,

Jeremy
 
Chrissie,

Thanks for the tip! I added Me.Combo43.Requery in OnClick & it worked. You're the best!

Jeremy
 
actually you dont need the me. but if you like it better that way, its fine by me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top