Combo Box Not Updating After Record Change

wilderfan

Registered User.
Local time
Today, 12:23
Joined
Mar 3, 2008
Messages
172
I have a form with a combo box which selects the record which I wish to change.

I make the change to one of the fields of the selected record.

Then, I may wish to choose another record, using the same combo box.

The choice of records offered by the combo box should no longer include the record which I previously changed. (The combo box is based on a query with a selection criteria which looks at the field which I have just changed.)

Is there a way to update the records immediately after I make changes to the record?

I wonder if this can be done without getting into ADO & recordsets.
 
Requery the combo in the OnCurrent Event procedure.

In VBA
Me!comboname.Requery
 
I tried the requery suggestion, but it didn't work.

The 2nd try at the combo box still showed the record which I had just tried to change.

The updating of the record isn't occurring until the form closes.

Maybe I do have to get into ADO and recordsets, after all, to solve this problem.
 
The first record must save before the changes will be reflected.
You need to move to another record or force it to save.

Use the AfterUpdate event of the affected field to trigger the save.
 
a combo box is normally bound to a field in a table - so changing it, just changes the stored value

what you are trying to do (or should be) is to use an UNBOUND combo box, to select an item - having selected the item you are then trying to reposition the record displayed, to the one based on the combo box

IMO the easiest way to do this is save the cbovalue in a variable, and have the query on which the the form is based use this cbovalue to select a single record

all you then have to do, is in the cbobox after update event, just do something like

gblvariable = cbobox
me.requery
 

Users who are viewing this thread

Back
Top Bottom