Error Message 3127

A

Amour

Hi I am new to access and was hoping someone could help me.

I am getting this message:

The INSERT INTO statement contains the following unknown field name: 'CELL''
Make sure you have typed the name correctly, and try the operation again.
Error 3127)

when I run this:

maketablestring = " INSERT INTO tblTempBTO IN '" & tmpLetterDB & "' " _
& " SELECT tblPersonnel.*, StrConv([FIRST_NAME],3) AS lcfirst,
StrConv([LAST_NAME],3) AS lclast, StrConv([addr1],3) AS lcaddr1,
StrConv([addr2],3) AS lcaddr2, StrConv([city],3) AS lccity,
StrConv([state],3) AS lcstate, StrConv([zip],3) AS lczip,
StrConv([company],3) AS lccompany, StrConv([title],3) AS lctitle" _
& " FROM tblPersonnel "
If qrystring <> "" Then
maketablestring = maketablestring & " where " & qrystring & "
order by last_name"
End If
dbLocal.Execute (maketablestring)

maketablestring is where I am getting it but I can not find anything that
says:

CELL

Please help

Thank You!
 
D

Douglas J. Steele

Try putting

Debug.Print maketablestring

before your Execute statement, to see the actual SQL that's going to be run.
(Look in the Immediate Window, which you get to using Ctrl-G, to see what's
printed)
 
A

Amour

Thank You for your help,

This is what I got from that:
INSERT INTO tblTempBTO IN 'c:\asb6\datafiles\letterfile03.mdb' SELECT
tblPersonnel.*, StrConv([FIRST_NAME],3) AS lcfirst, StrConv([LAST_NAME],3) AS
lclast, StrConv([addr1],3) AS lcaddr1, StrConv([addr2],3) AS lcaddr2,
StrConv([city],3) AS lccity, StrConv([state],3) AS lcstate, StrConv([zip],3)
AS lczip, StrConv([company],3) AS lccompany, StrConv([title],3) AS lctitle
FROM tblPersonnel where [SSN] like '999-99-9999' order by last_name


Thank You again for any help!


Douglas J. Steele said:
Try putting

Debug.Print maketablestring

before your Execute statement, to see the actual SQL that's going to be run.
(Look in the Immediate Window, which you get to using Ctrl-G, to see what's
printed)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Amour said:
Hi I am new to access and was hoping someone could help me.

I am getting this message:

The INSERT INTO statement contains the following unknown field name:
'CELL''
Make sure you have typed the name correctly, and try the operation again.
Error 3127)

when I run this:

maketablestring = " INSERT INTO tblTempBTO IN '" & tmpLetterDB & "' " _
& " SELECT tblPersonnel.*, StrConv([FIRST_NAME],3) AS lcfirst,
StrConv([LAST_NAME],3) AS lclast, StrConv([addr1],3) AS lcaddr1,
StrConv([addr2],3) AS lcaddr2, StrConv([city],3) AS lccity,
StrConv([state],3) AS lcstate, StrConv([zip],3) AS lczip,
StrConv([company],3) AS lccompany, StrConv([title],3) AS lctitle" _
& " FROM tblPersonnel "
If qrystring <> "" Then
maketablestring = maketablestring & " where " & qrystring &
"
order by last_name"
End If
dbLocal.Execute (maketablestring)

maketablestring is where I am getting it but I can not find anything that
says:

CELL

Please help

Thank You!
 
D

Douglas J. Steele

Sorry, I can't see any reason for that specific error message.

I would advise not storing data redundantly in the new table, though. Since
you're using tblPersonnel.* AND storing bits and pieces of various fields,
you will be doing so.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Amour said:
Thank You for your help,

This is what I got from that:
INSERT INTO tblTempBTO IN 'c:\asb6\datafiles\letterfile03.mdb' SELECT
tblPersonnel.*, StrConv([FIRST_NAME],3) AS lcfirst, StrConv([LAST_NAME],3)
AS
lclast, StrConv([addr1],3) AS lcaddr1, StrConv([addr2],3) AS lcaddr2,
StrConv([city],3) AS lccity, StrConv([state],3) AS lcstate,
StrConv([zip],3)
AS lczip, StrConv([company],3) AS lccompany, StrConv([title],3) AS
lctitle
FROM tblPersonnel where [SSN] like '999-99-9999' order by last_name


Thank You again for any help!


Douglas J. Steele said:
Try putting

Debug.Print maketablestring

before your Execute statement, to see the actual SQL that's going to be
run.
(Look in the Immediate Window, which you get to using Ctrl-G, to see
what's
printed)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Amour said:
Hi I am new to access and was hoping someone could help me.

I am getting this message:

The INSERT INTO statement contains the following unknown field name:
'CELL''
Make sure you have typed the name correctly, and try the operation
again.
Error 3127)

when I run this:

maketablestring = " INSERT INTO tblTempBTO IN '" & tmpLetterDB & "' " _
& " SELECT tblPersonnel.*, StrConv([FIRST_NAME],3) AS
lcfirst,
StrConv([LAST_NAME],3) AS lclast, StrConv([addr1],3) AS lcaddr1,
StrConv([addr2],3) AS lcaddr2, StrConv([city],3) AS lccity,
StrConv([state],3) AS lcstate, StrConv([zip],3) AS lczip,
StrConv([company],3) AS lccompany, StrConv([title],3) AS lctitle" _
& " FROM tblPersonnel "
If qrystring <> "" Then
maketablestring = maketablestring & " where " & qrystring
&
"
order by last_name"
End If
dbLocal.Execute (maketablestring)

maketablestring is where I am getting it but I can not find anything
that
says:

CELL

Please help

Thank You!
 

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

Similar Threads

Run-Time Error 3127 2
Mail Merge 1

Top