Type 13 error in an If statement in AfterUpdate Event

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to shift the focus to one of two controls, based on a value
selected in a control called cboLocation. When I make a selection in the
combo box I receive a "type mismatch" error. I've checked the data type of
the underlying field in the table -- it's text with 50 characters. I probably
have a syntax error, but am not sure what it is. I would appreciate any
assistance you can give. Here is the code that is in the AfterUpdate event of
cboLocation:

If [cboLocation] = "Manassas" Or "Baltimore" Then
Me.cboProgramArea.SetFocus
Me.cboProgramArea.Dropdown

Else:
Me.cboSourceName.SetFocus
Me.cboSourceName.Dropdown
End If
 
That did the trick! I knew I must have a syntax problem. Thanks ever so much.

tina said:
try

If Me!cboLocation = "Manassas" Or Me!cboLocation = "Baltimore" Then

hth


Susan L said:
I'm trying to shift the focus to one of two controls, based on a value
selected in a control called cboLocation. When I make a selection in the
combo box I receive a "type mismatch" error. I've checked the data type of
the underlying field in the table -- it's text with 50 characters. I probably
have a syntax error, but am not sure what it is. I would appreciate any
assistance you can give. Here is the code that is in the AfterUpdate event of
cboLocation:

If [cboLocation] = "Manassas" Or "Baltimore" Then
Me.cboProgramArea.SetFocus
Me.cboProgramArea.Dropdown

Else:
Me.cboSourceName.SetFocus
Me.cboSourceName.Dropdown
End If
 
Back
Top