Form filters

D

Dave

Hi everyone.

I have a button which opens a particular form filtered on a field,
RecipPK. That works fine, but I can't seem to be able to add a second
filter. (on AccessionNo, which is a text field) And it needs a
wildcard filter (like s*)
This may be where I'm having the difficulty. I've tried just about
every combination I can think of.
Any help appreciated.

Dave
 
A

Allen Browne

dim strWhere as string
strWhere = "([AccessionNo] Like ""s*"") AND ([AnotherField] = 999)"
DoCmd.OpenForm "Form2", WhereCondition:=strWhere

If the quotes in the middle of the string don't make sense, see:
Quotation marks within quotes
at:
http://allenbrowne.com/casu-17.html
 
D

Dave

dim strWhere as string
strWhere = "([AccessionNo] Like ""s*"") AND ([AnotherField] = 999)"
DoCmd.OpenForm "Form2", WhereCondition:=strWhere

If the quotes in the middle of the string don't make sense, see:
    Quotation marks within quotes
at:
   http://allenbrowne.com/casu-17.html

--
Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.




Hi everyone.
I have a button which opens a particular form filtered on a field,
RecipPK. That works fine, but I can't seem to be able to add a second
filter. (on AccessionNo, which is a text field) And it needs a
wildcard filter (like s*)
This may be where I'm having the difficulty.  I've tried just about
every combination I can think of.
Any help appreciated.
Dave- Hide quoted text -

- Show quoted text -

Thank you Allen,

Between your replies on this newsgroup and the tips on your website,
you've been a tremendous help to me.

Dave
 

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