By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,164 Members | 1,019 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,164 IT Pros & Developers. It's quick & easy.

Still have Type Mismatch Problem

P: n/a
Faz
Even after changing Invoice_ID to Clng(Invoice_ID) and trying to link
to the Reference_2 field which is text it is giving me a type mismatch
error.

So I created a new query in access where I took the field Invoice_ID,
Invoice_Amount and changed Invoice_ID into InvoiceID:
CLng([INVOICE_ID]).

Then I tried to join the new field InvoiceId (which is now without an
underscore and is text) to Reference_2 and still did nto work.

Please Help.

Thanks.
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
It would really help if you posted followups as responses in the original
message thread, so we could see what you've talked about before. From what
you say _here_, it seems as if you are trying to join a Long Integer (the
result of a Clng) to a text field. Try making certain they are the _same_
data type.

Then if that does not work, try to find the original message thread and
continue with a followup there. If you can't, the follow up here, but give
us the original background again. People really can't chase all over the
newsgroup trying to find what you posted before about the same issue.

Larry Linson
Microsoft Access MVP
"Faz" <af*****@hotmail.com> wrote in message
news:26*************************@posting.google.co m...
Even after changing Invoice_ID to Clng(Invoice_ID) and trying to link
to the Reference_2 field which is text it is giving me a type mismatch
error.

So I created a new query in access where I took the field Invoice_ID,
Invoice_Amount and changed Invoice_ID into InvoiceID:
CLng([INVOICE_ID]).

Then I tried to join the new field InvoiceId (which is now without an
underscore and is text) to Reference_2 and still did nto work.

Please Help.

Thanks.

Nov 13 '05 #2

P: n/a
Faz wrote:
Even after changing Invoice_ID to Clng(Invoice_ID) and trying to link
to the Reference_2 field which is text it is giving me a type mismatch
error.

So I created a new query in access where I took the field Invoice_ID,
Invoice_Amount and changed Invoice_ID into InvoiceID:
CLng([INVOICE_ID]).

Then I tried to join the new field InvoiceId (which is now without an
underscore and is text) to Reference_2 and still did nto work.

Please Help.

Thanks.


I would have 2 fields in a query...
InvoiceID : Invoice_ID
InvoiceLong : Invoice_ID

Same this as a query with whatever other fields you have.

Now create another query. Select the table where Invoice_ID is long and
the new query. Link to InvoiceLong.

Does that work?

If not, what type is the one that is number? Integer (Cint)? Double
(Cdbl)? You could make a query on the one that is a number and convert
to a string (CStr). I would probaly have both the real and the
converted in the same query.

Nov 13 '05 #3

P: n/a
Looks to me as if you have CLng() on the wrong field.
CLng() changes a value to the Long type - but you're still trying to link it
to a String field - Reference_2.

You can use CStr(Invoice_ID) to produce a string, which you can link to
Reference_2.
Or (probably more efficiently), you can use CLng(Reference_2) to produce a
Long type, which you can link to Invoice_ID.

HTH
- Turtle

"Faz" <af*****@hotmail.com> wrote in message
news:26*************************@posting.google.co m...
Even after changing Invoice_ID to Clng(Invoice_ID) and trying to link
to the Reference_2 field which is text it is giving me a type mismatch
error.

So I created a new query in access where I took the field Invoice_ID,
Invoice_Amount and changed Invoice_ID into InvoiceID:
CLng([INVOICE_ID]).

Then I tried to join the new field InvoiceId (which is now without an
underscore and is text) to Reference_2 and still did nto work.

Please Help.

Thanks.

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.