Me.Filter MsgBox

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

Guest

I am trying to filter records in a table and can't seem to
do it without a MsgBox asking for the value of the
strCode. Any suggestions?


table>>[ysnAvaliable] date type Yes/No

code is as follows:
Dim strCode As String
strCode = ""
strCode = "ysnAvaliable =" & True
Me.Filter = strCode
Me.FilterOn = True
 
Try this instead:

strCode = "ysnAvaliable = True"

In my test it worked as you have it which makes sense since the resulting
filter would be "ysnAvaliable=-1". I'm not sure why it isn't working for
you.

FWIW you don't need to initialize strCode with the empty string (strCode =
"")
 
Back
Top