Manually update a table based on a combobox?

  • Thread starter Thread starter Norm
  • Start date Start date
N

Norm

Hi All,

I have a combobox linked to a table, but the table values only update when
I switch records. I need to update those values as soon as the combobox
changes. I found an earlier post that seems related to this issue, and the
response was to use the following code:

Issue an individual update statement for each record:

Me.Dirty = False ' Avoid record locking ourselves out, save
the actual record, if
dirty...
CurrentDb.Execute "UPDATE yourTable SET Attribute=" &
NewAttribute & " WHERE ID IN(" &
ListOfIDtoModifyAttribute & ")"

I don't understand how to get the second line of code to work, and I'm not
sure this is even the right approach.

Please...suggestions?

Norm
 
All you need is the first line. The rest of the code is to update every
record which isn't necessary for you. Just put that code in the AfterUpdate
event of the combo box. Remember, by doing this you cannot undo the change
if there is a mistake.

Kelvin
 
Back
Top