Link AutoNumber to Text Field

  • Thread starter Thread starter mattc66 via AccessMonster.com
  • Start date Start date
M

mattc66 via AccessMonster.com

Hi All,

I have 2 tables that I need to link the AutoNumber to a Text Field in another
table. Is this possible?

If so, how do I do it?

Matt
 
No you can not as one is datatype of long integer and the other is text. The
data stored for a numerial one and a text one are totally different.

Why not change the text field to a number, long integer?

Alternately I think you can create a query of the table that has the text
field and output the field as a number field.
NumField: CLng([YourFieldName])
Then link your autonumber table to the query.
 
The trouble is the data comes from an external UPS database that has some
items in the fld that are text. I am trying to only link the items in the
table that match to my database which is an autonumber fld.



KARL said:
No you can not as one is datatype of long integer and the other is text. The
data stored for a numerial one and a text one are totally different.

Why not change the text field to a number, long integer?

Alternately I think you can create a query of the table that has the text
field and output the field as a number field.
NumField: CLng([YourFieldName])
Then link your autonumber table to the query.
[quoted text clipped - 4 lines]
 
Ok, then you will need to do the query and also use another field like this ---
NumField_2: Val([YourFieldName])
Then have criteria > 0

With the criteria you will pull only nunbers.

mattc66 via AccessMonster.com said:
The trouble is the data comes from an external UPS database that has some
items in the fld that are text. I am trying to only link the items in the
table that match to my database which is an autonumber fld.



KARL said:
No you can not as one is datatype of long integer and the other is text. The
data stored for a numerial one and a text one are totally different.

Why not change the text field to a number, long integer?

Alternately I think you can create a query of the table that has the text
field and output the field as a number field.
NumField: CLng([YourFieldName])
Then link your autonumber table to the query.
[quoted text clipped - 4 lines]
 
mattc66 said:
Hi All,

I have 2 tables that I need to link the AutoNumber to a Text Field in
another table. Is this possible?

If so, how do I do it?

SELECT *
FROM Table1 INNER JOIN Table2
ON CStr(Table1.AutoNumberField) = Table2.TextField

You will only be able to write the above query in SQL view and it will not be
very efficient as the index on the AutoNumber field cannot be utilized, but it
will work.
 

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

Back
Top