Lookup Combo Box Error

sal

Registered User.
Local time
Today, 14:46
Joined
Oct 25, 2009
Messages
52
I have a very straight forward (I think) combo box that I would be using to look up a record in a form:

'Find Survey# Record
Private Sub Combo201_AfterUpdate()

If IsNull(Me.Combo201) Then
Me.FilterOn = False
Else
Me.Filter = "Survey# = " & Me.Combo201
Me.FilterOn = True
End If
End Sub

Where the Survey# is an auto numerical key for the data, and it's giving me this error:

Runtime error 3075
Syntax error in date in query expression 'Survey# = 5'

I suspect the character # is causing the problem...Is this a bad naming convention on my part?
 
Yes it is; symbols should not be used. If you can't change it, bracketing will work:

Me.Filter = "[Survey#] = " & Me.Combo201
 

Users who are viewing this thread

Back
Top Bottom