Hi!
I have a Form that is in Datasheet 'mode'.
It sits in another Form that has 'header' information.
Each Form has as its record source a simple query based on a separate table.
For each Header record on the main form - the user will choose one or more items from the embedded datasheet.
This is not a Master-Detail Form. The Datasheet form merely shows available choices that the user can select.
The first field in the datasheet is a checkbox/Yes-No control.
I have code in the clicked event of the checkbox that puts various data from the main form and the embedded datasheet form into a couple of other tables in the DB. All working well.
What I would like to do is:
When the checkbox for a record is checked on the embedded datasheet -
add a value from the Main form . . .
to another field in the SAME record for which I just checked the checkbox on the datasheet.
I have put the Insert code in the LostFocus Event of the Checkbox control . . . and it is working . . .
BUT . . .
The LostFocus Event is firing twice:
The first time, it is writing the correct value from the Main Form to the table - but for the very first record on the datasheet [which I did not click]
The second time LostFocus fires, it is writing the correct data to the correct record [the one in which I clicked the checkbox].
I only need the value to go to the record for which I clicked the checkbox.
Should I be putting this code in another event altogether?
. .. scratching head . . .
I haven't been on here a while - I hope you are all well . . . Happy New Year!!