views:

131

answers:

2

I have a dropdownlist that has 4 columns but only 3 are 'visible' the first one is an ID, and after update I have the following code run.

DoCmd.SearchForRecord acDataForm, "new_order_thingy", acFirst, "[OrderID] = " & Me.Combo112.Column(0)

This used to get the record pertaining to the OrderID, I am not sure what I did but I somehow broke it. I don't get an error but it doesn't retrieve any data.

It does pass the correct value in Me.Combo112.Column(0) when I MsgBox it out.

Any help/suggestions would be appreciated.

Thanks

A: 

I suggest you place a breakpoint in your code. Then, change the value in the combo, and in break mode, hover the mouse over the variables.
This will also show you if the event is really fired.
Sometimes the link between the event and the procedure is lost (e.g. when you rename the object).

iDevlop
It is fired, and the variable does contain the data.
Bruno43
@Bruno43: In the same direction: if the code is in a form (which I suppose), replace "new_order_thingy" by me.name, just in case you renamed the form.
iDevlop
Just changed it to me.name still not doing anything.
Bruno43
A: 

The Form.DataEntry was set to YES, it should have been set to NO ... don't get why but thats what was causing my error.

Bruno43
Date Entry is a mode where only newly added records are loaded, so if your combo box lists all the records that existed at the time the form was open, it won't be able to find them, since pre-existing records are not loaded in a form with DataEntry set to True. The reason for Data Entry mode is efficiency in a multi-user context. Don't turn it on of you don't explicitly want your form to open with no pre-existing records and only a brand-new empty record ready for editing. Turning it off does not prevent the editing or addition of new records as long as you've turned those properties on.
David-W-Fenton