473,468 Members | 1,469 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

What's wrong with this multiple criteria search code?

9 New Member
I encountered a Type Mismatch error in the below line. Not sure how to best code this (error BOLDED). Please help.

Dim GCriteria As String
Dim strDate As String

If Len(Patient_Search) = 0 Or IsNull(Patient_Search) = True Then
MsgBox "You must enter a text to search."

Else

'Generate search criteria
GCriteria = cboSearchField.Value & " LIKE '*" & Patient_Search & "*'"
strDate = cboSearchDate.Value & " Between #" & Me.From & "# AND #" & Me.Thru & "#"

'Filter Referrals based on search criteria
Form_Referrals.RecordSource = "select * from [All Referrals Query] where " & GCriteria And strDate

Form_Referrals.Caption = "Referrals Search (" & cboSearchField.Value & " contains '*" & Patient_Search & "*')"

'Close Frm_Search
DoCmd.Close acForm, "Frm_Search"

MsgBox "Results have been filtered with part of patient's name within the date range (Blank = no match)."

End If
Jan 9 '19 #1
1 1263
pcheng
9 New Member
Never mind... I figured it out!! sorry
Jan 9 '19 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
mmarif4u
by: mmarif4u | last post by:
Hi Everyone. I have html page coding: HTML coding..... --------------------------------------------------- <h2>Search</h2> <form name="search" method="post" action="Search.php"> Seach for:...
3
by: developing | last post by:
Hello How do I specify multiple criteria for FindFirst or FindRecord (or anything else) that takes the criteria from a form. (text field and number field) edit: this will be in the after...
4
by: JHNielson | last post by:
I have a query that I'm trying to update with a dlookup with multiple criteria This is the string: EVNT_DT: DLookUp("","","( .EVNT_QTR=.) & (.=.)") When i run it it says it can't find the...
0
by: ChadK | last post by:
I am trying to open a report based on what the user selects on a form. Each individual criteria works but when I try to combine to pass multiple criteria it doesn't. I have read what I can find on...
49
by: martin DH | last post by:
Hello all, I'm back with another SQL related problem. The details are below, but in short: I am using Access 2003. I have a table whose structure may include four different associate names per...
12
by: azalea45 | last post by:
Hi all I am a newbie when it comes to access. My company requires that all Databases run on the company SQL back-end as a result i have a Access project that connects to the server. I have two...
3
by: kstevens | last post by:
Please help. I know the sysntax is wrong. Here are some details. I am looking for the sum of past shipped items. I originally wrote this Dsum with only one criteria, but because of multiple...
2
by: AnnMV8 | last post by:
Hi, I'm hoping someone can help me. I'm not a programmer but found this really nice piece of code that I have been using but it needs to be altered. I had been getting help from Microsoft's...
2
by: xavierp | last post by:
I just created a website which works fine on Firefox, Opera and Safari but some reason it just has a white tag when i try to open it up in Internet Explorer. I'm only in year 8 so it probably my...
4
by: DANNYOCEAN | last post by:
I have a code that sucessfully calculates how many numbers are lower than for example 45 , for large sample number list. But i´m looking for a code that have a COUNT function with MULTIPLE...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.