automatic update of query used as rowsource

simo7923

Registered User.
Local time
Today, 00:57
Joined
Jul 21, 2003
Messages
15
I'm synchronising 2 combo boxes so that the 1st will force the type of data in the 2nd. In the 2nd combo box ive set a simple query in the rowsource property. Now when i close down the property box for the query th query runs and produces the correct info in combo2. But after that if i change the data in combo1 the data in combo2 stays as the last query ran. The only way to change it again is to open up the combo property....back inot the rowsource properties and rerun the query. I've looked at the afterupdate function for combo1 but im no good at basic....any ideas for a simpleton guys?:(
 
In the AfterUpdate event of the the first combo box, have you tried:
Me.combobox2.Requery
 
No,i'm not too good with the basic. Would i just type that in when in the visual basic format (if you see what i mean). And i presume i could use a similar statement to that on a button in a form to requery the databse for new records?
 
In the design view of the form, double-click the first combo box. That should bring up the property sheet for the control (if it's not up already). Go to the Event tab. On the After Update line, select [Event Procedure], then click the three dot thingee to the right of that line. That will pull you into the Visual Basic editor and place you into the After Update event code for the control. Place the code into that procedure. Close the Visual Basic editor window. Then test your code.

You should really check out the Access Visual Basic help for basic info on how to write code.
 
I will do...cheerz for that. ANyone know of a good site for visual basic information. Its something i should learn really if im gonna get into this.
 

Users who are viewing this thread

Back
Top Bottom