Run time error "3615", type mismatch in expression (1 Viewer)

Ramshan

Registered User.
Local time
Today, 02:42
Joined
Aug 17, 2011
Messages
48
I was trying to bring down values from two different tables that have County(Numeric field) as a common field. But i am getting this error,
Run time error "3615", type mismatch in expression. I donno wat is the reason. Here is the snipet of my query,

SELECT dbo_hpr.ADDRESS, dbo_hpr.PROPNAME, Dbo_Bridges1.CITY, Dbo_Bridges1.ADDRESS
FROM Dbo_Bridges1 INNER JOIN dbo_hpr ON Dbo_Bridges1.[COUNTYCD] = dbo_hpr.[COUNTYCD]
WHERE (((dbo_hpr.ADDRESS) Like Nz(Forms!Prop_Bridges!comboaddr,"~") & "*"))

P.S: Here dbo_hpr - table1
Dbo_Bridges1 - table2
COUNTYCD is the Column name that exists in both the table. Can someone pls help me fixing it. Thanks in advance
 

spikepl

Eledittingent Beliped
Local time
Today, 10:42
Joined
Nov 3, 2010
Messages
6,144
County(Numeric field) as a common field.. so where is that in your query?
 

Ramshan

Registered User.
Local time
Today, 02:42
Joined
Aug 17, 2011
Messages
48
COUNTYCD is the field that contains the numeric values of all counties. And I have used in the below query.

SELECT dbo_hpr.ADDRESS, dbo_hpr.PROPNAME, Dbo_Bridges1.CITY, Dbo_Bridges1.ADDRESS
FROM Dbo_Bridges1 INNER JOIN dbo_hpr ON Dbo_Bridges1.[COUNTYCD] = dbo_hpr.[COUNTYCD]
WHERE (((dbo_hpr.ADDRESS) Like Nz(Forms!Prop_Bridges!comboaddr,"~") & "*")) OR (((dbo_hpr.COUNTYCD)=Forms!Prop_Bridges!combocounty)) & (((Dbo_Bridges1.COUNTYCD)=[Forms]![Prop_Bridges]![Combocounty]));
 

spikepl

Eledittingent Beliped
Local time
Today, 10:42
Joined
Nov 3, 2010
Messages
6,144
OK - next time you type a question take care to get the variable names right (see your first line).

So check in your two tables if CountyCD is a number in both, and if so, what is the actual content - see if some are null/empty etc
 

Ramshan

Registered User.
Local time
Today, 02:42
Joined
Aug 17, 2011
Messages
48
The field COUNTYCD in both the tables contains numeric value and yes there are some null values.
 

spikepl

Eledittingent Beliped
Local time
Today, 10:42
Joined
Nov 3, 2010
Messages
6,144
How do you know it's CountyCd that gives you grief? Did you check what's in your combos?

And changing your SQL while I am trying to debug it per remote vision is not going to help either - what the heck is (((dbo_hpr.COUNTYCD)=Forms!Prop_Bridges!combocount y)) & (((Dbo_Bridges1.COUNTYCD)=[Forms]![Prop_Bridges]![Combocounty])) ? It's neither here nor there - Access will make a Boolean out of the first part, a string out of the second, concatente the two, and it just makes no sense whatsoever,
 

Ramshan

Registered User.
Local time
Today, 02:42
Joined
Aug 17, 2011
Messages
48
My combo's are having numeric value in it. I have used a small look up table like below one
CountyName|CountyCD
Oklahoma 12
Payne 13

I didnt know that these values will be concatenated. I assumed that it will check both the conditions. Else how about using this (((dbo_hpr.COUNTYCD)=Forms!Prop_Bridges!combocount y)) OR (((Dbo_Bridges1.COUNTYCD)=[Forms]![Prop_Bridges]![Combocounty]))
 

Ramshan

Registered User.
Local time
Today, 02:42
Joined
Aug 17, 2011
Messages
48
Else is that possible for you to connect remotely and work on it? I even can't share the file bcos of its huge size(around 160 mb)
 

vbaInet

AWF VIP
Local time
Today, 09:42
Joined
Jan 22, 2010
Messages
26,374
The bound field of the combo box is Text, the second column is the numeric field. So you should be referring to the second COLUMN of your combo box.
 

Ramshan

Registered User.
Local time
Today, 02:42
Joined
Aug 17, 2011
Messages
48
In my query form, what is the Record Source I have to give?? Since it is taking values from two tables, should I have include both the table names in the record source???
 

vbaInet

AWF VIP
Local time
Today, 09:42
Joined
Jan 22, 2010
Messages
26,374
I will explain in a bit. But what is the first column in the Row Source of your combo box? And also, what is the Bound Column property set to?
 

Users who are viewing this thread

Top Bottom