R
Rick
I am trying to write code to prevent an individual from
exiting a form without filling in all of the required data
and I have most of it working except the part relating to
the sub form.
What happens is both the last name and first name
have to be filled in on the main form (this part works).
In the subform, the status (inbound/assigned) needs to be
filled in as well but it seems to be stuck in a loop
because when I update the "Code" field, it still sees it
as null. After selecting OK, enter the data in the
subform, it returns the same msgbox and reverts back to
the code field.
Here is what I have done:
Private Sub Command18_Click()
On Error Resume Next
If (IsNull([Member_Last_Name])) Then
MsgBox "You must enter the individuals last name
of this record.", vbCritical
Me.Member_Last_Name.SetFocus
ElseIf (IsNull([Member_First_Name])) Then
MsgBox "You must enter the individuals first
name of this record.", vbCritical
Me.Member_First_Name.SetFocus
ElseIf (IsNull(Forms![subfrmAddIntro]!
exiting a form without filling in all of the required data
and I have most of it working except the part relating to
the sub form.
What happens is both the last name and first name
have to be filled in on the main form (this part works).
In the subform, the status (inbound/assigned) needs to be
filled in as well but it seems to be stuck in a loop
because when I update the "Code" field, it still sees it
as null. After selecting OK, enter the data in the
subform, it returns the same msgbox and reverts back to
the code field.
Here is what I have done:
Private Sub Command18_Click()
On Error Resume Next
If (IsNull([Member_Last_Name])) Then
MsgBox "You must enter the individuals last name
of this record.", vbCritical
Me.Member_Last_Name.SetFocus
ElseIf (IsNull([Member_First_Name])) Then
MsgBox "You must enter the individuals first
name of this record.", vbCritical
Me.Member_First_Name.SetFocus
ElseIf (IsNull(Forms![subfrmAddIntro]!
Code:
)) Then
MsgBox "You must fill members status, inbound
or assigned."
Forms![subfrmAddIntro]![Code].SetFocus
Else: DoCmd.Close
Form.Refresh
Forms![frmMain]![Code] = "58 SOW CSS
Database"
End If
end sub
Any assistance is greatly appreciated. Thanks in advance!