Avatar of morinia
moriniaFlag for United States of America

asked on 

Error in Make Table query in Access, but ignoring error table is created

I am getting the following error when creating a table in Microsoft Access.  The query works fine when it is not creating a table.  Also when I chose to ignore the error and create table, the table is created.  

User generated imageMake Table Error.docx


MicrosoftMicrosoft Access

Avatar of undefined
Last Comment
Gustav Brock
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Seems you have one or more rows that doesn't have a name that follows:  letters <space> letters.

No idea how the query works without the INTO.  One or more of the first or last name fields should show an error.

I'm not an Access Expert so there may be a better way but this is what I came up with:
SELECT A1.ProviderID, A1.[Provider Name], Replace(A1.[Provider Last Name],',',' ') AS [Provider Last Name], A1.[Provider First Name], A1.Specialty, A1.NPI INTO Updated_Providers
FROM (
SELECT
	Providers.[ProviderID],
	Providers.[Provider Name],
	IIf(InStr([Provider Name]," ")=0," ", Left([Provider Name],InStr([Provider Name]," "))) AS [Provider Last Name],
	IIf(InStrRev([Provider Name]," ")=0," ", Mid([Provider Name],InStrRev([Provider Name]," "))) AS [Provider First Name],
	IIf(Providers.Specialty Is null, "   ",Providers.Specialty) AS Specialty,
	IIf(Providers.NPI Is null,"    ",Providers.NPI) AS NPI
FROM Providers
) as A1;

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Microsoft Access
Microsoft Access

Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.

226K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo