PC Review


Reply
Thread Tools Rate Thread

append data or insert into or something else?

 
 
Julie
Guest
Posts: n/a
 
      31st Oct 2008
Hi all

I am new to using Access 2007 and have a question for you experts.

I am interested in adding a new record and inserting some data from one
table to annother, based on some rules.

I have a long string and I want to, for each parsed section of the string (I
have hthe parsing code working fine in visual basic) I want to search table
A. Each time I find a record that contains the parsed phrase in either one of
two fields, I want to append a new record to table B with the contents of a
few of the fields from table A. I am not sure if this is something I can do
with the query, or an Append command, or an Insert into command, it seems the
query probably won't work and it needs to be coded. I come from a visual
foxpro background and there I could have done an append from table A for ...
I would appreciate any suggestions for how best to accomplish this in Access
2007/Visual Basic.
Regards, (and HAPPY HALLOWEEN), Julieinstance, if a
--
Thanks for your help. Julie
 
Reply With Quote
 
 
 
 
Beetle
Guest
Posts: n/a
 
      31st Oct 2008
You would use an Append query. The basic syntax would be like;

"INSERT INTO TableB (Field1, Field2, Field3) SELECT Field1, Field2 " _
& "Field3 FROM TableA WHERE TableA.FieldX = """ & YourParsedString _
& """ OR TableA.FieldY = """ & YourParsedString & """;"

You can find more detailed info at;

http://msdn.microsoft.com/en-us/library/bb208861.aspx
--
_________

Sean Bailey


"Julie" wrote:

> Hi all
>
> I am new to using Access 2007 and have a question for you experts.
>
> I am interested in adding a new record and inserting some data from one
> table to annother, based on some rules.
>
> I have a long string and I want to, for each parsed section of the string (I
> have hthe parsing code working fine in visual basic) I want to search table
> A. Each time I find a record that contains the parsed phrase in either one of
> two fields, I want to append a new record to table B with the contents of a
> few of the fields from table A. I am not sure if this is something I can do
> with the query, or an Append command, or an Insert into command, it seems the
> query probably won't work and it needs to be coded. I come from a visual
> foxpro background and there I could have done an append from table A for ...
> I would appreciate any suggestions for how best to accomplish this in Access
> 2007/Visual Basic.
> Regards, (and HAPPY HALLOWEEN), Julieinstance, if a
> --
> Thanks for your help. Julie

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Update/insert or append? Robbie Microsoft Access 5 22nd Jan 2009 07:21 PM
INSERT SQL to append recs frm another Table, NULL DATE append 30/1 accesshar Microsoft Access VBA Modules 2 14th Jan 2008 02:00 PM
Append only files (append Data permission) =?Utf-8?B?Um9nZXIgTWlsbGVy?= Microsoft Windows 2000 Security 1 5th Feb 2007 10:05 PM
calculate, insert and append cporter@dallas.photronics.com Microsoft Access Macros 0 12th Apr 2006 03:40 PM
Re: Failing to insert data using append query John Vinson Microsoft Access Queries 0 25th Jul 2003 11:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:52 PM.