Setting a value cause record selection to change

L

Larry

I'm using an OnExit in the last field in a subform to run a macro to update
fields in the main form, based on entries in the current record in the
subform. There's a series of Setvalue that work, but before executing a
specific one, it jumps to the first record in the subform (continuous list)
and executes the setvalue from the field in that record.

I've moved the setvalue statement around while stepping through the macro
and it always happens prior to executing this statement. It's just setting a
byte value from a field in the subform to a byte field in the main form. I
have another setvalue doing exactly the same thing that works ok.

The only thing I can see at all is that the db field names on the main form
and the sub form are the same (not the case for the other fields that work)

I hoping someone has some info so I don't have to do several changes just to
test the field name guess.

Any ideas?
Thanks
 
L

Larry

Update: To restate the problem: after editing/adding a record in a subform,
I'm executing a macro to update field from the subform to the mainform with a
series of 'setvalue' actions. After executing the 4th setvalue, the record
selection jumps to the first record in the subform and continues executing
with the fields in the first record.

Further testing revealed that the problem occurs upon completion of the 4th
setvalue action, regardless of what that setvalue is.

Also it doesn't matter exactly what step in the macro, just that it's the
4th setvalue action.

I've changed around the order in which the steps execute and nothing
changes, it's always after executing the 4th setvalue action that the record
selection changes.

This is driving me crazy. Any ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top