View Full Version : SelectCase Error


JustPunkin
02-05-2009, 10:56 AM
I've got this bit of code that is giving me a hard time.

If IsNull(Me.txtCustomer.Value) Then
strCustomer = "Like '*'"
Else
selectcase Me.frmCustName.Value
Case 1
strCustomer = "Like '" & Me.txtCustomer.Value & "*'"
Case 2
strCustomer = "Like '*" & Me.txtCustomer.Value & "*'"
Case 3
strCustomer = "Like '*" & Me.txtCustomer.Value & "'"
Case 4
strCustomer = "= '" & Me.txtCustomer.Value & "'"
End Select
End If

I knew I would have issues when "selectcase" did not format itself as a function (I think that's the right word).

Any ideas why?

boblarson
02-05-2009, 10:57 AM
Put a space between the two words. It is SELECT CASE with a space.

JustPunkin
02-05-2009, 10:59 AM
:o Thanks. That was quick and easy.