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

What's the event I'm looking for 1

Status
Not open for further replies.

YellowOnline

Technical User
Mar 31, 2004
144
BE
This is probably a very easy question, but I just can't figure it out. I got a mainform with a cbo, showing 1 record at a time. Every record shows a subform with items connected to it. The names of these items are in a cbo dependent on the cbo in the main form. I made a button on the main form that requeries the cbo:
Code:
Private Sub btnRequery_Click()
    Me!frmMain.Form!cboIngredients.Requery
End Sub
This works perfectly, but of course, I don't want the user to push a button every time he or she views another record. So I tried to connect this execution to the main form cbo, called cboPlant. I tried On Change, On Dirty, After Update,... but none seems to do this automatically. What's the event happening when you change from one record to another?

On a sidenote, the form has two purposes: entering data and viewing data. With After Update it will probably work for nex data. But I want the existing data to requery the cbo as well.

In short: I'm looking for an event that requeries when the main form cbo changes, no matter if it changes by the user or by browsing the records.

 
Look at the Current event of the form.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I think I know what you mean. I have this on a form but a list boxes.

On After update of Listbox1

Listbox2.requery

Does that not work did you say?
 
I added the requery to the cbo's After Update for new ingredients and I also added it, as you said, to the Current Event from the form. that does exactly what I wanted. I forgot the forms theselves have Events too. Thank you very much PHV.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top