If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
data type mismatch error
Hi,
I have two tables .. 1.tblPhys (fields are SSN, Sal) 2.tblTransTemp (fields are SSN, Sum,....) the SSN field type is Text (not number) I designed a form(frmTransA) which is connected to the tblTransTemp. I have a combo box on the form frmTransA, thru which I can select the SSN from the tblPhys I have a text box, named Sal When I select the SSN the Sal text box should populate the corresponding value of that SSN . This is the statement I Wrote for the After Update event of SSN Combo : Me!Sal = DLookup("[Sal]", "tblPhys", "[SSN]=" & Forms!frmTransA!SSN) But When I select the SSN .." Data Type MisMatch in Criteria Expression " error is popping up . Do any one of you know how can I get rid of this error? Please Help Thanks Praveen |
#2
|
|||
|
|||
data type mismatch error
Hi Praveen,
Change this line: Me!Sal = DLookup("[Sal]", "tblPhys", "[SSN]=" & Forms!frmTransA!SSN) To: Me!Sal = DLookup("[Sal]", "tblPhys", "[SSN]='" & Forms!frmTransA!SSN & "'") that's [SSN]=single quote double quote and after the & it's double quote single quote double quote HTH Steve C "Praveen Manne" wrote in message ... Hi, I have two tables .. 1.tblPhys (fields are SSN, Sal) 2.tblTransTemp (fields are SSN, Sum,....) the SSN field type is Text (not number) I designed a form(frmTransA) which is connected to the tblTransTemp. I have a combo box on the form frmTransA, thru which I can select the SSN from the tblPhys I have a text box, named Sal When I select the SSN the Sal text box should populate the corresponding value of that SSN . This is the statement I Wrote for the After Update event of SSN Combo : Me!Sal = DLookup("[Sal]", "tblPhys", "[SSN]=" & Forms!frmTransA!SSN) But When I select the SSN .." Data Type MisMatch in Criteria Expression " error is popping up . Do any one of you know how can I get rid of this error? Please Help Thanks Praveen |
#3
|
|||
|
|||
data type mismatch error
Hi Steve,
Thank you very much for your reply.. That worked Praveen "Steve Conway" wrote in message ... Hi Praveen, Change this line: Me!Sal = DLookup("[Sal]", "tblPhys", "[SSN]=" & Forms!frmTransA!SSN) To: Me!Sal = DLookup("[Sal]", "tblPhys", "[SSN]='" & Forms!frmTransA!SSN & "'") that's [SSN]=single quote double quote and after the & it's double quote single quote double quote HTH Steve C "Praveen Manne" wrote in message ... Hi, I have two tables .. 1.tblPhys (fields are SSN, Sal) 2.tblTransTemp (fields are SSN, Sum,....) the SSN field type is Text (not number) I designed a form(frmTransA) which is connected to the tblTransTemp. I have a combo box on the form frmTransA, thru which I can select the SSN from the tblPhys I have a text box, named Sal When I select the SSN the Sal text box should populate the corresponding value of that SSN . This is the statement I Wrote for the After Update event of SSN Combo : Me!Sal = DLookup("[Sal]", "tblPhys", "[SSN]=" & Forms!frmTransA!SSN) But When I select the SSN .." Data Type MisMatch in Criteria Expression " error is popping up . Do any one of you know how can I get rid of this error? Please Help Thanks Praveen |
#4
|
|||
|
|||
data type mismatch error
Glad to help
Steve C "Praveen Manne" wrote in message ... Hi Steve, Thank you very much for your reply.. That worked Praveen "Steve Conway" wrote in message ... Hi Praveen, Change this line: Me!Sal = DLookup("[Sal]", "tblPhys", "[SSN]=" & Forms!frmTransA!SSN) To: Me!Sal = DLookup("[Sal]", "tblPhys", "[SSN]='" & Forms!frmTransA!SSN & "'") that's [SSN]=single quote double quote and after the & it's double quote single quote double quote HTH Steve C "Praveen Manne" wrote in message ... Hi, I have two tables .. 1.tblPhys (fields are SSN, Sal) 2.tblTransTemp (fields are SSN, Sum,....) the SSN field type is Text (not number) I designed a form(frmTransA) which is connected to the tblTransTemp. I have a combo box on the form frmTransA, thru which I can select the SSN from the tblPhys I have a text box, named Sal When I select the SSN the Sal text box should populate the corresponding value of that SSN . This is the statement I Wrote for the After Update event of SSN Combo : Me!Sal = DLookup("[Sal]", "tblPhys", "[SSN]=" & Forms!frmTransA!SSN) But When I select the SSN .." Data Type MisMatch in Criteria Expression " error is popping up . Do any one of you know how can I get rid of this error? Please Help Thanks Praveen |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
error: "...website is using your identity to access a data source..." | LO | General Discussion | 6 | July 8th, 2004 05:01 PM |
How to create graphs in a monthly report where the base data can change | John Clarke | Charts and Charting | 3 | June 25th, 2004 02:22 AM |
An expression you entered is the wrong data type | Hafeez Chudhary | General Discussion | 0 | June 22nd, 2004 10:52 PM |
Complicated issue re 'Type mismatch in JOIN expression' | Adam | General Discussion | 10 | June 14th, 2004 09:39 AM |
Importing from Excel to Access | yolanda | Worksheet Functions | 2 | May 13th, 2004 10:16 AM |