update only working on first record in the form

K

Kim

Ihave a form
on the form I have a combo box.
When I make a change in the combo box and click a button I want to run a
script that will update the record I am currently looking at.

problem is - I can be on ANY record and the SQL will reflect the first
record.

No matter which record I am on when I execute the query.

what am I doing wrong?

Kim
 
W

Wayne Morgan

Please show us the code (copy and paste to prevent typos) that you are using
in the button click so that we may see what you're doing.
 
P

Pat Hartman

You need a where clause in the query that selects only the current record.
BUT, why are you running a query to update the current record anyway? You
don't need to do that. More importantly, there are situations where you
will get error messages telling you that you are updating a record that is
being updated by someone else. That someone else will actually be you. To
update the current record, just place a value in the field you want to
update:
Me.SomeField = "somevalue"
 
K

Kim

Wow - Thank you Pat -
Sometimes you cannot see the trees through the forrest.
As always I was making it more complicated than usual.

Thanks, Kim
 
Top