Me.Filter MsgBox

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
 
S

Sandra Daigle

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 =
"")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top