Combo Box "Not Remembering"

kmeulemans

Registered User.
Local time
Today, 07:29
Joined
Aug 25, 2009
Messages
14
All,
I am having problems with my Combo box "remembering" what values were selected.
I have a cascading set of combo boxes where a user selects the area in the first combo box and then in the 2nd combo box the user can select the options that correspond the to options selected in the first combo box. That all works fine. but if the user goes to the next record then goes back to record that was just entered, the option selected in the 2nd combo box is no longer shown.

The correct data is dumped into my form, but it is no longer shown on the form once the user navigates to a different record.

Any Idea on why this would be acting like this?

(There is picture attached that shows this)
 

Attachments

  • Acces.jpg
    Acces.jpg
    60.7 KB · Views: 102
Are either of them not bound to a field in the table?
 
They are both bound to a table. They both pull info from Machine Table and then dump the selections into tblOpen...
 
They are both bound to a table. They both pull info from Machine Table and then dump the selections into tblOpen...

If the ID's are being stored then they should both update when moving to existing records. But, just to be safe you can put, in the form's Current event, somthing either like:

YourFirstCombo_AfterUpdate

or

Me.YourSecondCombo.Requery

and see if either of those help. If not, maybe post a copy of the db here.
 
I've got a Me.requery event in the after update...


Private Sub CategoryAfterUpdate()
Me.Product = Null
Me.Product.Requery
Me.Product = Me.Product.ItemData(0)
End Sub
 
I've got a Me.requery event in the after update...


Private Sub CategoryAfterUpdate()
Me.Product = Null
Me.Product.Requery
Me.Product = Me.Product.ItemData(0)
End Sub
Don't set Me.Product equal to anything in that code. If you do it will reset anything that is in the other combo. And you don't need to set Me.Product = Null.

You're overthinking this. All you need is to have the query for the rowsource of Me.Product be set by limiting the CategoryID in the underlying query.

I would suggest posting your database here and we can solve this quickly (if 2007 db then maybe save as 2003 version so more of us can help right away).
 
I would love to upload my Database...(it is 2003)
its like 10 times to big...
 
I would love to upload my Database...(it is 2003)
its like 10 times to big...

Have you tried

1. going to Tools > Database Utilities > COMPACT AND REPAIR

and

2. THEN going to the file, right-click on it and select SEND TO > COMPRESSED FOLDER and then checking to see how big it is?
 
I have the Data base now uploaded...
If you could take a look at it, I would really appreciate it
 

Attachments

Okay, here you go. The rowsources were a little messed up so take a look at both to see how I did it. Also, your number of fields and which column was bound needed to be changed. And, we had to add Me.Product.Requery to the on current event of the form.
 

Attachments

Bob,
You are the man! Thank you.
I see what you changed. If there is ever anything i can do to help you out let me know...
(i'm a Mechanical Engineer, so prints or calculations or something in that vein)....
 
I have one more quick question. On those Combo boxes from yesterday, you can select and see the machine names, but it only dumps the ID number into the data collection table. What do you need to do to get it to dump the machine name as well?
 
Never mind. Got it working

You shouldn't be storing the machine name in the table too. You store the ID (as per the rules of NORMALIZATION) as you can get the machine name by using a QUERY.
 

Users who are viewing this thread

Back
Top Bottom