in
Private Sub cbojoblocautonum_AfterUpdate()
Me![joblocautonum] = Forms!frmljncCleaning!cbojoblocautonum
End Sub
Private Sub LstClockid_AfterUpdate()
Me![ClockId] = Forms!frmljncCleaning!LstClockid
End Sub
Private Sub txtDateAssigned_AfterUpdate()
Me![DateAssigned] = Forms!frmljncCleaning!txtDateAssigned
End Sub
Those won't do anything unless you have the cleaning table
bound to the main form? Check that please. It may be what's
causing the overwrite.
You should remove the code from all three events.
Also remove any code from the subform's events and the
controls on the subform's controls' events
With that done, changing any of the controls on the mainform
should not have any effect on the subform.
test that this is the case, and add the following to the
cbojoblocautonum_AfterUpdate() event (or to the onClick event
of a new command button labeled "Assign job to employee")
Dim strSQL as string
strSQL = "Insert into tblCleaning "_
strSQL = strSQL & "(DateAssigned, ClockId, joblocautonum) "
strSQL = strSQL & " values(#" & me.txtDateAssigned & "#, "
strSQL = strSQL & me.LstClockid & ", "
strSQL = strSQL & me.cbojoblocautonum & ");"
docmd.runSQL strSQL
me.frmljncCleaning.Requery
The form acts a noted before with or without the above code
putting in what is selected in the Main form into ONLY the
1st record and overwriting it each time a new selection is
made.
Not what else I may need. Thanks for still helping - I can
give you more details or refer to previous tables for help
Thanks,
Barb
:
=?Utf-8?B?YmFicw==?= <
[email protected]>
wrote in
I set up the main form based off of the cleaning table
and reinserted the personnel list box using the wizard
and the same for the joblocautonum drop down list.
along with DateAssigned in Mainform
Added the subform for cleaning
including all the cleaning fields. In the mainform
after I selected the peronnel, joblocautonum and date
assigned 1 record is put into the subform. When I go
back to same Mainform the select an additional
combination it OVERWrited record ONE instead of Adding a
new record. Not sure where I am going wrong????????
Thanks for helping,
Barb
Please post the code in the afterupdate event for the
three controls.
There is probably a DoCmd.GoToRecord , , acNewRec that
needs to be set somewhere.