T
Tara
I have a subform and I'm trying to run some code in the On Enter event that
tells the user that the field is only used under certain conditions and then
resets the focus back to a different control. I know you can't diable
controls on subforms so I thought my solution would in essence produce the
same result. However, I'm getting an error message that I don't understand.
It says: "The expression On Enter you entered as the event property setting
produced the following error: A problem occurred while Microsoft Access was
communicating with the OLE server or Active X control" It goes on the
mention that the expression may be result in the name of a macro, etc or
there may have been an error evaluating the function, etc.
Here's the code I have in the On Enter event of the control:
Private Sub Score_Enter()
Dim intResponse As Integer
Dim strMsg As String
If Me.ToolID = 2 Then
strMsg = "The score field can only be used in conjunction with the
Edinburgh Scale."
intReponse = MsgBox(strMsg, vbOKOnly)
If intReponse = vbOKOnly Then
Me.SetFocus.ToolID
End Sub
tells the user that the field is only used under certain conditions and then
resets the focus back to a different control. I know you can't diable
controls on subforms so I thought my solution would in essence produce the
same result. However, I'm getting an error message that I don't understand.
It says: "The expression On Enter you entered as the event property setting
produced the following error: A problem occurred while Microsoft Access was
communicating with the OLE server or Active X control" It goes on the
mention that the expression may be result in the name of a macro, etc or
there may have been an error evaluating the function, etc.
Here's the code I have in the On Enter event of the control:
Private Sub Score_Enter()
Dim intResponse As Integer
Dim strMsg As String
If Me.ToolID = 2 Then
strMsg = "The score field can only be used in conjunction with the
Edinburgh Scale."
intReponse = MsgBox(strMsg, vbOKOnly)
If intReponse = vbOKOnly Then
Me.SetFocus.ToolID
End Sub