Combo Box Type Mismatch

G

GitarJake

Hello all,

I keep getting a Runtime error 13 "type mismatch error" when I try to select
records with my combo box. Here is the sql statement:

SELECT DISTINCTROW Contacts.UNIQUE_ID, Contacts.Company
FROM Contacts INNER JOIN Sales ON Contacts.UNIQUE_ID = Sales.Contact
WHERE (((Contacts.IDStatus) Like "*customer*"))
ORDER BY Contacts.Company;

When I try to create a new combo box, the wizard gives me this error:

Syntax error in query expression '[SELECT DISTINCTROW
[Contacts]].[Unique_ID]'.

Can someone tell me my flaw here?


Tia!
 
P

Pavel Romashkin

First off, are you using the join to filter the Contacts table? I don't
see the Sales table being used at all.
The only thing I can suspect is that IDStatus is a numeric field,
containing an ID so it can not be compared with a string.
I suggest taking this SQL into the query builder and checking it there.

Good luck,
Pavel
 
G

GitarJake

Hi Pavel,
First off, are you using the join to filter the Contacts table? I don't
see the Sales table being used at all.

No not a filter, just left over.

The combo box was working well when it had it's own record source. When I
borrowed the sql from a query that had alternate tables I wanted to use, the
posted errors occured.

The combo and the forms record sources are the same.

After cleaning it up, the error still exists.
The only thing I can suspect is that IDStatus is a numeric field,
containing an ID so it can not be compared with a string.
I suggest taking this SQL into the query builder and checking it there.

One curious tidbit is that UNIQUE_ID is text field. Could it be that
combo boxes require a numeric field?
Good luck,
Pavel

Thank you Pavel, I think I will need all the good luck I can get!

Jake
GitarJake said:
Hello all,

I keep getting a Runtime error 13 "type mismatch error" when I try to select
records with my combo box. Here is the sql statement:

SELECT DISTINCTROW Contacts.UNIQUE_ID, Contacts.Company
FROM Contacts INNER JOIN Sales ON Contacts.UNIQUE_ID = Sales.Contact
WHERE (((Contacts.IDStatus) Like "*customer*"))
ORDER BY Contacts.Company;

When I try to create a new combo box, the wizard gives me this error:

Syntax error in query expression '[SELECT DISTINCTROW
[Contacts]].[Unique_ID]'.

Can someone tell me my flaw here?

Tia!
 
P

Pavel Romashkin

I don't think the combo box cares whether the field is text or numeric.
However, if it is bound to a numeric field in the table and has a text
field in the row source, it might be a problem. Check the bindin
carefully and make sure the row source query returns the right fields.
Pavel
Hi Pavel,
First off, are you using the join to filter the Contacts table? I don't
see the Sales table being used at all.

No not a filter, just left over.

The combo box was working well when it had it's own record source. When I
borrowed the sql from a query that had alternate tables I wanted to use, the
posted errors occured.

The combo and the forms record sources are the same.

After cleaning it up, the error still exists.
The only thing I can suspect is that IDStatus is a numeric field,
containing an ID so it can not be compared with a string.
I suggest taking this SQL into the query builder and checking it there.

One curious tidbit is that UNIQUE_ID is text field. Could it be that
combo boxes require a numeric field?
Good luck,
Pavel

Thank you Pavel, I think I will need all the good luck I can get!

Jake
GitarJake said:
Hello all,

I keep getting a Runtime error 13 "type mismatch error" when I try to select
records with my combo box. Here is the sql statement:

SELECT DISTINCTROW Contacts.UNIQUE_ID, Contacts.Company
FROM Contacts INNER JOIN Sales ON Contacts.UNIQUE_ID = Sales.Contact
WHERE (((Contacts.IDStatus) Like "*customer*"))
ORDER BY Contacts.Company;

When I try to create a new combo box, the wizard gives me this error:

Syntax error in query expression '[SELECT DISTINCTROW
[Contacts]].[Unique_ID]'.

Can someone tell me my flaw here?

Tia!
 

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

Similar Threads

Syntax error 1
Combo Box Error 2
Problem with Combo box on form 1
Add <ALL> to combo box 9
combo box data type 1
Cannot add a record 2
Stumped by a Type mismatch error 2
Data type mismatch? 5

Top