I have seen another post where deleting the target control fixed the issue, but it hasn't worked for me unfortunately so here goes.
I have a combo box with PositionID, PositionName on a form with a listbox below which shows related training record to that PositionID. I have another form, a target form, which can be used to add further records in the listbox for that PositionID, if AddBtn is clicked. I have placed a textbox called PositionID in the form footer in the form footer and a combobox called TrainingName. This is so that I can add multiple trainings at once, to one PositionID. I have the following codes:
On the source form:
On the target form I have:
I get the following error when I click on AddBtn:
***Edit: I have just figured out that if I move to a new record in the target form, the PositionID in the footer goes back to 0. Is there a way to keep that same?*** Thanks
I have a combo box with PositionID, PositionName on a form with a listbox below which shows related training record to that PositionID. I have another form, a target form, which can be used to add further records in the listbox for that PositionID, if AddBtn is clicked. I have placed a textbox called PositionID in the form footer in the form footer and a combobox called TrainingName. This is so that I can add multiple trainings at once, to one PositionID. I have the following codes:
On the source form:
Code:
Private Sub AddBtn_Click()
docmd.openform "frmTraining" , , , , , acFormAdd, Me.PositionID
End Sub
On the target form I have:
Code:
Private Sub Form_Open(Cancel As Integer)
Me.PositionID = Me.OpenArgs
End Sub
I get the following error when I click on AddBtn:
***Edit: I have just figured out that if I move to a new record in the target form, the PositionID in the footer goes back to 0. Is there a way to keep that same?*** Thanks
Last edited: