Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make table creates auto number - do not want auto 2

Status
Not open for further replies.

lmarks

Technical User
Mar 2, 2004
6
US
I am running a make table query and the primary key of one of the source tables is a number. I want this number in my new table. The make table query creates this field as an Auto number and so fails to add the records to the table.
Is there are way to force the make table query to create a number field rather than an auto number?

I hope this is clear...
Thank you
 
I have run into this a bunch lately building cross references... I just wrap the Autonumber field with the Clng function... That converts it to a long and Access can't see the original datatype of autonumber.

Anytime you have datatype issues in action queries, dig out the "C" functions.
 
I have figured it out.. I used Alias:Val(field_name) in the make table query and this inserted the alias in the new table as a number rather than an autonumber.. go -figure....
 
Same basic idea... Val returns the number, since it is a number you should be ok. The concern would be that for some reason Access thinks the datatype should be something other than a long integer... I would stick with clng.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top