Solved

Changing a field type while using INTO

Posted on 2001-07-26
5
619 Views
Last Modified: 2007-11-27
I am attempting to create a table called TempSentList that contains a list of people who belong to selected mail list(s). The mail list names are selected from an unbound list (that is the "criteria" reference in the code below).

Everything is looking good so far, except that I receive the following error:

Run-Time Error: 3090
Resultant table not allowed to have more than one AutoNumber field.

This is due to the fact that both the [Mail List].ID and the People.ID fields are AutoNumber.

Question: How can I convert one or both of these AutoNumber fields to a Number or even Text field in the process of creating this TempSentList table?

Thanks!




strSQL = "SELECT DISTINCTROW [Mail List].[Mail List], [Mail List].ID, [Mail List].Inactive, " & _
"People.ID, People.Last, People.First, People.Company, True As Selected, 1 as Copies " & _
"INTO TempSentList FROM [Mail List] LEFT JOIN [People] ON [Mail List].ID = People.ID " & _
"WHERE ((([Mail List].[Mail List]) = " & Criteria & "))"
0
Comment
Question by:FinanciallyFree
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 54

Accepted Solution

by:
nico5038 earned 150 total points
ID: 6324869
I would just create a result table on forhand (TempSentList ) and use a "DELETE * FROM TempSentList;" followed by an append query.

When the fields in the TempSentList are defined  as numeric, then you'll have no problems.

Nic;o)
0
 
LVL 18

Expert Comment

by:nigelrivett
ID: 6325220
try converting one of them to an int.
You may also get into trouble for duplicate named columns - can't remember what access does with that.

strSQL = "SELECT DISTINCTROW [Mail List].[Mail List], [Mail List].ID, [Mail List].Inactive, " & _
"PeopleID: cvint(People.ID), People.Last, People.First, People.Company, True As Selected, 1 as Copies " & _
"INTO TempSentList FROM [Mail List] LEFT JOIN [People] ON [Mail List].ID = People.ID " & _
"WHERE ((([Mail List].[Mail List]) = " & Criteria & "))"

(that syntax is probably wrong but the principle is worth a try).
0
 

Author Comment

by:FinanciallyFree
ID: 6327390
Nice and simple - I like it!!
Thanks, nico5038!

0
 
LVL 54

Expert Comment

by:nico5038
ID: 6327535
You're welcome FinanciallyFree.

Sccess with the application !

Nic;o)
0
 
LVL 1

Expert Comment

by:__Holly__
ID: 7138492
nico just a qucik note to let you know that you rock my world!!!
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question