473,326 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Multiple criteria on filter

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
2 8695
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: William Wisnieski | last post by:
Hello Everyone, I have a main form with a datasheet subform that I use to query by form. After the user selects two criteria on the main form and clicks the cmdShowResults button on the main...
6
by: Ralph2 | last post by:
Some time ago with a lot of help from this group I made a reasonably successful database to keep track of our shop drawings. However the searching mechanism is too complicated for the occasional...
6
by: kcddoorman | last post by:
I built a select query filled with fields from multiple tables and queries. I have one field in this particluar query that will filter out a single order number. In the criteria box I put and that...
6
by: Dave | last post by:
On my form I have combo boxes. These combo boxes, after updating them, populate respective listboxes that are located below the combo boxes on the same form. I am trying to use a "generate...
1
by: Barb.Richards | last post by:
I have created an append query that pulls information from one database, and will append the selected information into a new table. The fields are setup like 'number' 'category' 'code' 'shares' and...
3
by: jcf378 | last post by:
Hi all-- Does anyone have any insight as to how I might create a search form that allows a user to select criteria based on any related table in the whole database. The search form I have now only...
1
by: jcf378 | last post by:
Hi all-- Does anyone have any insight as to how I might create a search form that allows a user to select criteria based on any related table in the whole database. The search form I have now only...
6
by: iheartvba | last post by:
Hi, I have a form where users have to go through a lot of data. The data is being viewed in a list box. This is because they need to be able to select one of the items in the list. The list box...
4
by: jvan2008 | last post by:
"Form1" combobox "cboModel" Row Source SELECT ., . FROM tblModel ORDER BY ; combobox "cboContactName" SELECT . FROM Query1 ORDER BY ;
1
by: woodey2002 | last post by:
Hi Everyone and many thanks for your time.. I am trying to begin access and a bit of VBA i am enjoying it but I have a annoying problem I just can’t get any where on. My databse mostly includes...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.