Error data type mismatch

E

Eric

Why it gives that error. Both tables have same type of number
Data type mismatch

qry = "SELECT tbl_EquipmentChronology.Equipment1 FROM
tbl_EquipmentChronology WHERE tbl_EquipmentChronology.Outlet = '" &
Forms!tbl_PPVResearch_Edit!frm_Events!PPVVOD_Outlet & "';"
Set rst = CurrentDb.OpenRecordset(qry)

tbl_EquipmentChronology
Outlet Number

tbl_Events
PPVVOD_Outlet Number

Type of PPVVOD_Outlet was text then i change it with number but i did
nothing in the form. Is there is any thing which i do in the subform
too?
 
E

Eric

I did some little more change in the query but still same data mismatch
error:

qry = "SELECT tbl_EquipmentChronology.Equipment1 FROM
tbl_EquipmentChronology INNER JOIN tbl_events ON
tbl_events.PPVVOD_Outlet=tbl_EquipmentChronology.Outlet WHERE
tbl_EquipmentChronology.Outlet = '" &
Forms!tbl_PPVResearch_Edit!frm_Events!PPVVOD_Outlet & "';"
 
R

RoyVidar

Eric said:
I did some little more change in the query but still same data
mismatch error:

qry = "SELECT tbl_EquipmentChronology.Equipment1 FROM
tbl_EquipmentChronology INNER JOIN tbl_events ON
tbl_events.PPVVOD_Outlet=tbl_EquipmentChronology.Outlet WHERE
tbl_EquipmentChronology.Outlet = '" &
Forms!tbl_PPVResearch_Edit!frm_Events!PPVVOD_Outlet & "';"

Single quotes are needed when concatenating parameters meant for text
fields into SQL strings. Remove those single quotes, no delimiters are
needed when passing numbers.
 

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


Top