By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,647 Members | 1,444 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,647 IT Pros & Developers. It's quick & easy.

Multiple criteria on filter

P: n/a
Hi All,
I am trying to filter a continuous form based on the value of a text box
within the same form. I have 2 fields I am trying to use in my where clause
but keep getting a Type Mismatch each time it executes. It works fine if I
comment out before the OR!!!

The code is:

DoCmd.ApplyFilter , "star1 like '*" & Me.txt_Search_Criteria.Value & "*'" Or
_
"star2 like '*" & Me.txt_Search_Criteria.Value & "*'"

I've tried the help section but to no avail. Could anyone please point me in
the right direction?

TIA,

Mark
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Br
Mark <ma**********@ntlworld.com> wrote:
Hi All,
I am trying to filter a continuous form based on the value of a
text box within the same form. I have 2 fields I am trying to use in
my where clause but keep getting a Type Mismatch each time it
executes. It works fine if I comment out before the OR!!!

The code is:

DoCmd.ApplyFilter , "star1 like '*" & Me.txt_Search_Criteria.Value &
"*'" Or _
"star2 like '*" & Me.txt_Search_Criteria.Value & "*'"

I've tried the help section but to no avail. Could anyone please
point me in the right direction?

TIA,

Mark


The OR should be part of your string.

DoCmd.ApplyFilter , "star1 like '*" & Me.txt_Search_Criteria.Value &
"*' Or star2 like '*" & Me.txt_Search_Criteria.Value & "*'"
--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response
Nov 13 '05 #2

P: n/a
Worked a treat thank you. I can see where I was going wrong now!

Thanks again,

Mark
"Br@dley" <n0****@4u.com> wrote in message
news:dy******************@news-server.bigpond.net.au...
Mark <ma**********@ntlworld.com> wrote:
Hi All,
I am trying to filter a continuous form based on the value of a
text box within the same form. I have 2 fields I am trying to use in
my where clause but keep getting a Type Mismatch each time it
executes. It works fine if I comment out before the OR!!!

The code is:

DoCmd.ApplyFilter , "star1 like '*" & Me.txt_Search_Criteria.Value &
"*'" Or _
"star2 like '*" & Me.txt_Search_Criteria.Value & "*'"

I've tried the help section but to no avail. Could anyone please
point me in the right direction?

TIA,

Mark


The OR should be part of your string.

DoCmd.ApplyFilter , "star1 like '*" & Me.txt_Search_Criteria.Value &
"*' Or star2 like '*" & Me.txt_Search_Criteria.Value & "*'"
--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.