Combo Box Staying Synced with Record

DirtDiverKF

Registered User.
Local time
Today, 05:33
Joined
Oct 17, 2011
Messages
12
Hi guys, I have a form whose record set is a query. On the form i have a unbound combo box that drives the record for the form. This all works well except after i edit the record and save it, if i hit refresh the record goes to the first record in the table and the combo stays where its at. How do i make my combo box stay synced with the form. I tried to bind it to a field but it goes nuts on me when i do this for some reason. Thanks.
 
A "find a record" combo should not be bound, so you have that correct. Otherwise when you search for a record, it changes the value for the record currently displayed, which you obviously don't want.

I just blank them out after doing a lookup, but if you wanted it to display the same record, you could use the current event to place the value there. I think that would fire when you refreshed.
 
Thank you for the quick reply, what do you mean current event? How do i apply current event to the combo box? Blanking it is fine to, would you just do a me!ComboBox"" or something in vba for the combo?
 
I do this:

Me.cmbFindDriver = ""

I meant you could use the current event of the form to set the value of the combo to the value from the current record.
 
on the combo box, it has a macro built in to it, where do you add the me.cmb = "" code? I cant add it to the after update cause of the macro, so where else can i put that to work? Thank you again
 
well maybe not, problem is on change, the stupid thing clears out everytime i try to type in it hehehe, i guess i need to build a macro to set the value to 0, any tips on how to do this, thanks.
 
found in another forum to add a go to control macro and go to another field on my form, then do a set value on the combo box to "", seems to work, anyone know if this will create issues or not, thanks again.
 
I wouldn't bother with another macro. You should be able to add a SetValue line to the end of the existing macro.
 
yeah thats what i did, just added lines to it, worked ok, thanks again for your help. I will be posting another question tonight i believe, about how to take my equipment list and my donated equipment list and do a report / query that tells me which equipment i have here not donated yet, so if you think of what i need to know to do this go ahead and post.

right now i have my table with all the purchased equipment, ill be building a form tonight that allows me to select a location and donate the equipment to them, i just need to know how to track what is not donated, etc.
 
Sounds like you need the unmatched query wizard. It will find what's in one table and not in the other.
 

Users who are viewing this thread

Back
Top Bottom