J
John Flynn
I have a form with some text boxes used to capture some
text input. After the input box is updated I test the
value in a Function called DataOwnerNameValid. If I fail
the validation test I give the user a message. I then want
to return the cursor to the Input box so the user can
reenter the data.
I tried the earlier suggestion as follows but now get an
error message:
Private Sub DataOwnerInputBox_Exit(ByVal Cancel As
MSForms.ReturnBoolean)
If DataOwnerForm.DataOwnerInputBox = "" Then Exit Sub
xOwner = DataOwnerForm.DataOwnerInputBox
OwnerOK = DataOwnerNameValid(xOwner)
If OwnerOK = False Then
MsgBox "The Data Owner Name must be in the format:
Lastname, Firstname. Your input is - " & xOwner & " - and
does not meet the format required. Try again or cancel.",
vbExclamation, "Data Owner Name Invalid"
DataOwnerForm.DataOwnerInputBox.Cancel = True
End If
End Sub
Now I get an error message:
Could not set the cancel property. Member not Found.
Subject: Re: Text Box on User Form Set Focus Issue
From: "Tom Ogilvy" <[email protected]> Sent: 9/6/2003
7:21:41 AM
Use the Exit event and set cancel = True if the entry is
not valid.
text input. After the input box is updated I test the
value in a Function called DataOwnerNameValid. If I fail
the validation test I give the user a message. I then want
to return the cursor to the Input box so the user can
reenter the data.
I tried the earlier suggestion as follows but now get an
error message:
Private Sub DataOwnerInputBox_Exit(ByVal Cancel As
MSForms.ReturnBoolean)
If DataOwnerForm.DataOwnerInputBox = "" Then Exit Sub
xOwner = DataOwnerForm.DataOwnerInputBox
OwnerOK = DataOwnerNameValid(xOwner)
If OwnerOK = False Then
MsgBox "The Data Owner Name must be in the format:
Lastname, Firstname. Your input is - " & xOwner & " - and
does not meet the format required. Try again or cancel.",
vbExclamation, "Data Owner Name Invalid"
DataOwnerForm.DataOwnerInputBox.Cancel = True
End If
End Sub
Now I get an error message:
Could not set the cancel property. Member not Found.
Subject: Re: Text Box on User Form Set Focus Issue
From: "Tom Ogilvy" <[email protected]> Sent: 9/6/2003
7:21:41 AM
Use the Exit event and set cancel = True if the entry is
not valid.