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!

How to requery listbox from another form 1

Status
Not open for further replies.

dklions

Programmer
Jul 20, 2001
7
US

Hello,

I have a form frm1 with several option buttons and databound listbox. Everytime I chose an option the listbox is requeried and works just fine.

However, when I try to do this from another form frm2 frm1.lisbox does not appear to to requered.

here is my code from frm2 :

Forms!frm1.setfocus
Forms!frm1.listbox.RowSource=sSQL_string
Forms!frm1.listbox.Requery

Any idea what am I missing?

thanks



 
You don't need the setfocus unless you are doing that so the user is transported back to the other form. If you change the rowsource of a listbox, Access will automatically requery, so the requery is not needed. And your format should be changed to this:

Forms!frm1!ListBox.RowSource = sSQL_string

HTH Joe Miller
joe.miller@flotech.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top