dbTalk Databases Forums  

Issues with using append & delete queries in a simple archiving macro

comp.databases.ms-access comp.databases.ms-access


Discuss Issues with using append & delete queries in a simple archiving macro in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Sue
 
Posts: n/a

Default Issues with using append & delete queries in a simple archiving macro - 11-28-2010 , 09:14 AM






I am trying to get a simple archive process working on a simple
database ( archiving data from a basic customer table) and I keep
getting this error message:

" The INSERT INTO statement contains the following unknown field name
'[First Name], make sure you typed correctly etc."

I have checked the queries find the data in a simple select query and
have then changed them to an Append/ Delete query which I am running
through a macro. The data is being added to an archive table which I
have created by changing the select table to a Make Table query. I
have aslo added to the macro SetWarnings False and set it as true
again at the end.

Here is the SQL code for the Append query- can anyone shed any light
on why I cannot get this to work?

INSERT INTO tblMember_Archive ( MemberID, [First Name], Surname, [Post
held], Address1, Address2, Address3, Postcode, [Telephone No], [Date
Joined], DOB )
SELECT tblMember.MemberID, tblMember.[First Name], tblMember.Surname,
tblMember.[Post held], tblMember.Address1, tblMember.Address2,
tblMember.Address3, tblMember.Postcode, tblMember.[Telephone No],
tblMember.[Date Joined], tblMember.DOB
FROM tblMember
WHERE (((tblMember.[Date Joined])<[Forms]![frmArchiveData]!
[txtArchiveDate]));

Reply With Quote
  #2  
Old   
Tony Toews
 
Posts: n/a

Default Re: Issues with using append & delete queries in a simple archiving macro - 11-28-2010 , 04:06 PM






On Sun, 28 Nov 2010 07:14:33 -0800 (PST), Sue
<swbcteach (AT) googlemail (DOT) com> wrote:

Quote:
I am trying to get a simple archive process working on a simple
database ( archiving data from a basic customer table)
Personally I never archive data but mark such records as inactive.
And all forms and reports respect that flag.

When it comes to customers I might mark them with a few different
statuses such as "business closed so never bother to contact them",
"customer didn't pay their last bill so don't deal with them." or "we
haven't heard from them for a while so still worth contacting every
year or so."

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files
updated see http://www.autofeupdater.com/

Reply With Quote
  #3  
Old   
James A. Fortune
 
Posts: n/a

Default Re: Issues with using append & delete queries in a simple archiving macro - 11-29-2010 , 03:51 PM



On Nov 28, 10:14*am, Sue <swbcte... (AT) googlemail (DOT) com> wrote:
Quote:
I am trying to get a simple archive process working on a simple
database ( archiving data from a basic customer table) and I keep
getting this error message:

" The INSERT INTO statement contains the following unknown field name
'[First Name], make sure you typed correctly etc."

I have checked the queries find the data in a simple select query and
have then changed them to an Append/ Delete query which I am running
through a macro. The data is being added to an archive table which I
have created by changing the select table to a Make Table query. I
have aslo added to the macro SetWarnings False and set it as true
again at the end.

Here is the SQL code for the Append query- can anyone shed any light
on why I cannot get this to work?

INSERT INTO tblMember_Archive ( MemberID, [First Name], Surname, [Post
held], Address1, Address2, Address3, Postcode, [Telephone No], [Date
Joined], DOB )
SELECT tblMember.MemberID, tblMember.[First Name], tblMember.Surname,
tblMember.[Post held], tblMember.Address1, tblMember.Address2,
tblMember.Address3, tblMember.Postcode, tblMember.[Telephone No],
tblMember.[Date Joined], tblMember.DOB
FROM tblMember
WHERE (((tblMember.[Date Joined])<[Forms]![frmArchiveData]!
[txtArchiveDate]));
Try a query similar to the following (after backing up the original
table) in order to narrow down the possibilities:

INSERT INTO tblMember_Archive ( MemberID, [First Name], Surname, [Post
held], Address1, Address2, Address3, Postcode, [Telephone No], [Date
Joined], DOB ) SELECT 11111, 'Jane', 'Doe', 'CFO', '123 Main', Null,
Null, '99999', '8005551212', #11/26/2010#, #5/5/1985#;

James A. Fortune
CDMAPoster (AT) FortuneJames (DOT) com

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.