G
Guest
Hi all i am trying to prevent a form from closing by checking for zero length
in the before update
my msg comes up "you must enter Cable Type"
but the form closes i have tried going to the control but it seems the form
has closed and new msg says there is no control named" Cable Type"
i have Cancel=True but the form still closes
If Len(Me.CableType & "") = 0 Then
GoTo NoCableType
Else
MsgBox "Length of CableType is [" & Len(Me.CableType & "") & "]" &
vbCrLf & _
"...and contains [" & Me.CableType & "]"
End If
ExitHere:
Exit Sub
NoCableType:
MsgBox "Please Enter a Cable Type", vbOKOnly
Cancel = True
GoTo ExitHere
End Sub
in the before update
my msg comes up "you must enter Cable Type"
but the form closes i have tried going to the control but it seems the form
has closed and new msg says there is no control named" Cable Type"
i have Cancel=True but the form still closes
If Len(Me.CableType & "") = 0 Then
GoTo NoCableType
Else
MsgBox "Length of CableType is [" & Len(Me.CableType & "") & "]" &
vbCrLf & _
"...and contains [" & Me.CableType & "]"
End If
ExitHere:
Exit Sub
NoCableType:
MsgBox "Please Enter a Cable Type", vbOKOnly
Cancel = True
GoTo ExitHere
End Sub