I have a job tracking database that includes a customer subform. When a user adds a new customer they click a button that opens a pop up form. After entering the info, the customer ID is entered into the base form.
The problem is that the name of the base form may vary depending on the type of job. Please help me with coding so that the field it updates is based on the current form.
Follows is my code. I receive an error "object Required"
Private Sub cmdClose_Click()
On Error GoTo Err_CmdClose_Click
Dim Temp As Integer
Dim frmCurrentForm As Form
'Assign the new Rolodex ID to a temp holding spot
Temp = [intRolodex_ID]
'Close the Pop Up form
DoCmd.Close
'Assign the name of the main form
Set frmCurrentForm = Screen.ActiveForm
Set frmCurrentForm![intRolodex_ID] = Temp
Exit_CmdClose_Click:
Exit Sub
Err_CmdClose_Click:
MsgBox Err.Description
Resume Exit_CmdClose_Click
End Sub
The problem is that the name of the base form may vary depending on the type of job. Please help me with coding so that the field it updates is based on the current form.
Follows is my code. I receive an error "object Required"
Private Sub cmdClose_Click()
On Error GoTo Err_CmdClose_Click
Dim Temp As Integer
Dim frmCurrentForm As Form
'Assign the new Rolodex ID to a temp holding spot
Temp = [intRolodex_ID]
'Close the Pop Up form
DoCmd.Close
'Assign the name of the main form
Set frmCurrentForm = Screen.ActiveForm
Set frmCurrentForm![intRolodex_ID] = Temp
Exit_CmdClose_Click:
Exit Sub
Err_CmdClose_Click:
MsgBox Err.Description
Resume Exit_CmdClose_Click
End Sub