J
jbyrnz via AccessMonster.com
I have a combo box control for a yes/no field and a lookup table for the
yes/no field.
After Update I want Access to check the value and if it is -1, then I want a
text box to become visible and to have the focus and a message box to
indicate that the text box needs a value. When the user clicks OK on the
message box, I want the visible text box to have the focus and not let go of
the focus until a valid string is entered in the text box or the combo box is
updated again, back to the default value of 0. Then, I want the visible text
box to become invisible and the focus to go onto the next control.
This is my sub:
Private Sub ClaimYesNoCbo_AfterUpdate()
If Me!ClaimYesNoCbo = -1 And Me!ClaimIDTxt Is Null Then
Me.ClaimIDTxt.Visible = True
Me.ClaimIDTxt.SetFocus
MsgBox "You have indicated that this incident has been followed by a
claim. Please enter in a Claim Number for this claim."
End If
End Sub
No matter how I've tried to modify the code syntax I keep getting an 'Object
Required' error message, and I don't know why.
My questions are: What are some of the causes for this error message? What
can I try with my code that might eliminate the error message?
yes/no field.
After Update I want Access to check the value and if it is -1, then I want a
text box to become visible and to have the focus and a message box to
indicate that the text box needs a value. When the user clicks OK on the
message box, I want the visible text box to have the focus and not let go of
the focus until a valid string is entered in the text box or the combo box is
updated again, back to the default value of 0. Then, I want the visible text
box to become invisible and the focus to go onto the next control.
This is my sub:
Private Sub ClaimYesNoCbo_AfterUpdate()
If Me!ClaimYesNoCbo = -1 And Me!ClaimIDTxt Is Null Then
Me.ClaimIDTxt.Visible = True
Me.ClaimIDTxt.SetFocus
MsgBox "You have indicated that this incident has been followed by a
claim. Please enter in a Claim Number for this claim."
End If
End Sub
No matter how I've tried to modify the code syntax I keep getting an 'Object
Required' error message, and I don't know why.
My questions are: What are some of the causes for this error message? What
can I try with my code that might eliminate the error message?