T
TeeSee
Private Sub CustomerIDCode_Exit(Cancel As Integer)
If IsNull(Me!CustomerIDCode) Then
MsgBox "You must enter a Customer Code before entering other
data!"
End If
'Me.CustomerIDCode.SetFocus
Cancel = True
End Sub
On the above form there are two text controls, one of which is
[CustomerIDcode]. When I place the cursor in the other control the
MsgBox appears as expected. I first tried the "SetFocus" but read in a
post that that caused conflict .... so changed it to Cancel=True which
works as expected. The problem arises when (assuming) the user does
not have the appropriate [CustomerIDCode] and decides to "bail" then
clicks the command button on the form to cancel the transaction with
the following code .....
Private Sub Command23_Click()
If (Me.Dirty = True) Then
Me.Undo
End If
' And close me
DoCmd.Close acForm, Me.Name
End Sub
I now have two questions.
1) The command button is obviously a control on the same form and
since I try to enter it the message box appears as usual. how would I
exclude the cancel command button from the MsgBox code?
2) A Is the form "Dirty" the instand I place the cursor in the second
control or does there actually need to be input?
Thanks as usual.
If IsNull(Me!CustomerIDCode) Then
MsgBox "You must enter a Customer Code before entering other
data!"
End If
'Me.CustomerIDCode.SetFocus
Cancel = True
End Sub
On the above form there are two text controls, one of which is
[CustomerIDcode]. When I place the cursor in the other control the
MsgBox appears as expected. I first tried the "SetFocus" but read in a
post that that caused conflict .... so changed it to Cancel=True which
works as expected. The problem arises when (assuming) the user does
not have the appropriate [CustomerIDCode] and decides to "bail" then
clicks the command button on the form to cancel the transaction with
the following code .....
Private Sub Command23_Click()
If (Me.Dirty = True) Then
Me.Undo
End If
' And close me
DoCmd.Close acForm, Me.Name
End Sub
I now have two questions.
1) The command button is obviously a control on the same form and
since I try to enter it the message box appears as usual. how would I
exclude the cancel command button from the MsgBox code?
2) A Is the form "Dirty" the instand I place the cursor in the second
control or does there actually need to be input?
Thanks as usual.