cboBox

nelslynn

Registered User.
Local time
Today, 02:34
Joined
Oct 8, 2001
Messages
40
I have two questions:

Immediately after a combo box update I need to requery the combo box, but cannot until the record is saved and the record will not be save until I move to the next record... I do not want to move to the next record, but to the next field.

Second question:
Also regarding a combo box... is there a way to capture the previous value of the combo box after it has been updated?

Thanks.
 
Don't quite understand your 1st question.

Are you saying that you can't requery the combo box until the record is saved yet you want to requery it whilst data for the record is being entered? :confused:

In answer to your second question you can capture the previous value of a control by using the .OldValue property. This'll be fine whilst the record is Dirty i.e. the changes haven't yet been saved
 
I want to requery only the combobox after changing the value in the combo box. In order to requery the combo box to reflect the correct values, I need to save the record that I am currently on.

cboBox afterUpdate >> save the record, then requery the combobox, then move to the next field of the record I am currently editing.
 
Ok

Try the follwing in the AfterUpdate event of your combo box:

DoCmd.RunCommand acCmdSaveRecord

Then in the GotFocus event on your next field:

cboYourComboBoxNameHere.Requery

One thing to bear in mind though, if you have fields on your form that are required entries then the DoCmd statement won't work until all required entries are made.

Also once the record has been saved you won't be able to capture the previous value using .OldValue

HTH
Rob
 

Users who are viewing this thread

Back
Top Bottom