Unwanted Message box when applying filter (1 Viewer)

Fr33dan

New member
Local time
Today, 00:05
Joined
Oct 23, 2008
Messages
5
Hi. I've been working on a database for awhile now and I have a button on a form that is supposed to apply a filter based on criteria from the user. However when I actually go to apply the filter in the code I get an message asking to input the value for the filter even though I stated it in the code.
Code:
FileName = ("AutoNumber=" + numbers)
MsgBox (FileName)
Me.Filter = FileName
Me.FilterOn = True
The message box call is just something I added to debug it. If I type in the value that is returned manually the filter works as it's supposed to. I've also tried using DoCmd.ApplyFilter but i get the same error. Thanks in advance for your help.
 

Kempes

Registered User.
Local time
Today, 05:05
Joined
Oct 7, 2004
Messages
327
I think your problem lies with the +.

Change it to & and see what happens? I imagine that numbers will actually be a number!

Out of interest, what was displaying in your message box?
 

Fr33dan

New member
Local time
Today, 00:05
Joined
Oct 23, 2008
Messages
5
I figured it out. The name of my field is Auto Number not AutoNumber. In my display box "AutoNumber=1" is what was displaying. Thanks anyway.
 

Users who are viewing this thread

Top Bottom