Unanswered: Microsoft Access VB Run Time Error '2185'
Question: I have a form with with a text box and when the user enters his information into text box after it saves I want it to automatically add the text ADA-xxxx. I have tried using MS accesses Build Event and choose "Expression Builder" But I am getting an error. Can Someone please help me???
The Error I am getting is:
Run-time error '2185':
"You can't reference a property or method for a control unless the control has the focus. Try one of the following: 1) Move the focus to the control before you reference the property. In Visual Basic code, use the SetFocus method. In a macro, use the GoToControl action.
2) Reference or set the property from a macro or event procedure that runs when the GotFocus event for the Control occurs."
My Code is listed below:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Left(LABEL_TAG.Text, 4) <> "ADA-" Then
LABEL_TAG.Text = "ADA-" & LABEL_TAG.Text