larrydavid
Programmer
Hello,
I have a subform open which has a combobox. AfterUpdate() on this combo box, a modal popup form appears for user input. On the Form_Close() event, I am trying to set the values to controls on the subform:
Private Sub Form_Close()
If IsNull(Me.cboEntity) = True And IsNull(Me.cboLOC) = True And IsNull(Me.cboCostCenter) = True And IsNull(Me.cboExpCode) = True Then
MsgBox ("All fields are required!")
Else
Forms![frm_Test]!txtEntity = Me.cboEntity.Column(1)
Forms![frm_Test]!txtLOC = Me.cboLOC.Column(1)
Forms![frm_Test]!txtCostCenter = Me.cboCostCenter.Column(1)
Forms![frm_Test]!txtExpCode = Me.cboExpCode.Column(1)
DoCmd.Close
End If
End Sub
But I am getting this error when "X"ing out of the form:
Run-time error '2450'
Test Application can't find the form 'frmTest' referred to in a macro expressions of Visual Basic code.
Any help greatly appreciated as always.
Thanks,
Larry
I have a subform open which has a combobox. AfterUpdate() on this combo box, a modal popup form appears for user input. On the Form_Close() event, I am trying to set the values to controls on the subform:
Private Sub Form_Close()
If IsNull(Me.cboEntity) = True And IsNull(Me.cboLOC) = True And IsNull(Me.cboCostCenter) = True And IsNull(Me.cboExpCode) = True Then
MsgBox ("All fields are required!")
Else
Forms![frm_Test]!txtEntity = Me.cboEntity.Column(1)
Forms![frm_Test]!txtLOC = Me.cboLOC.Column(1)
Forms![frm_Test]!txtCostCenter = Me.cboCostCenter.Column(1)
Forms![frm_Test]!txtExpCode = Me.cboExpCode.Column(1)
DoCmd.Close
End If
End Sub
But I am getting this error when "X"ing out of the form:
Run-time error '2450'
Test Application can't find the form 'frmTest' referred to in a macro expressions of Visual Basic code.
Any help greatly appreciated as always.
Thanks,
Larry