A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

data type mismatch error



 
 
Thread Tools Display Modes
  #1  
Old June 30th, 2004, 09:32 PM
Praveen Manne
external usenet poster
 
Posts: n/a
Default 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  
Old June 30th, 2004, 09:59 PM
Steve Conway
external usenet poster
 
Posts: n/a
Default 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  
Old June 30th, 2004, 10:49 PM
Praveen Manne
external usenet poster
 
Posts: n/a
Default 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  
Old June 30th, 2004, 11:02 PM
Steve Conway
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 04:41 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.