I have one form, operator_details, that has a close button, which when clicked on runs code;
Private Sub close_Click()
Forms!training_record_tableview1.Refresh
On Error GoTo HandleError
DoCmd.RunCommand acCmdSaveRecord
DoCmd.close ObjectType:=acForm, ObjectName:="operator_details", Save:=acSave
HandleExit:
Exit Sub
HandleError:
MsgBox Err.Description
Resume HandleExit
End Sub
My problem is that the form operator_details is accessed via 2 different forms. One being training_record_tableview1, which is being refreshed when operator_details closes, the other form it is accessed from is signin.
The problem is, if the form operators_details is accessed from signin and then closed I get a runtime error 2450, cannot reference training_record_tableview1.
The reason operator_details is opened from 2 different forms is that the information in the form is relevant to the two forms that can open it.
My question is, I hope simple, how do I stop this error occurring.
Many thanks for your time.
Private Sub close_Click()
Forms!training_record_tableview1.Refresh
On Error GoTo HandleError
DoCmd.RunCommand acCmdSaveRecord
DoCmd.close ObjectType:=acForm, ObjectName:="operator_details", Save:=acSave
HandleExit:
Exit Sub
HandleError:
MsgBox Err.Description
Resume HandleExit
End Sub
My problem is that the form operator_details is accessed via 2 different forms. One being training_record_tableview1, which is being refreshed when operator_details closes, the other form it is accessed from is signin.
The problem is, if the form operators_details is accessed from signin and then closed I get a runtime error 2450, cannot reference training_record_tableview1.
The reason operator_details is opened from 2 different forms is that the information in the form is relevant to the two forms that can open it.
My question is, I hope simple, how do I stop this error occurring.
Many thanks for your time.