Re: Help with INSERT
From: Michel Walsh (vanderghast_at_VirusAreFunnierThanSpam)
Date: 01/17/05
- Next message: Paul James: "Re: using VBA to print out lists of query tables and fields"
- Previous message: John Vinson: "Re: How do I do a Query with 3 joins?"
- In reply to: Scott Bridges: "Help with INSERT"
- Next in thread: Scott Bridges: "Re: Help with INSERT"
- Reply: Scott Bridges: "Re: Help with INSERT"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 17 Jan 2005 13:32:34 -0500
Hi,
You make a join with a standard SELECT statement.
If tableA has three records, a, b, and c, while tableB as four records, 1,
2, 3, and 4, then
SELECT tableA.f1, tableB.g1
FROM tableA, tableB
will generate the 12 possibilities
a 1
a 2
a 3
a 4
...
c 3
c 4
You can then change the SELECT statement into an INSERT statement, in the
query designer, from its menu or form the toolbar. The goal is to get the
SELECT statement right, as you want it, and once you are happy with it,
change it for an insert (if you need it: you can build a from or a report
from a SELECT query, no obligation to necessary use a table).
Hoping it may help,
Vanderghast, Access MVP
"Scott Bridges" <ScottBridges@discussions.microsoft.com> wrote in message
news:A26AAFE0-AC94-4988-8A4B-F7A71CD55ED9@microsoft.com...
> I'm very new to Access, and trying to learn SQL at the same time.
>
> I'm working on a database in Access to track calls and correspondence.
> Thanks to help from this group I now have a query to pull all contacts
> that
> have not received a call or letter in the last 45 days. Now, lets say its
> time to send out a newsletter to all the contacts. The tables are one to
> many, Contacts to Calls.
>
> I have a small form that has fields for Date, Time, Subject and Notes. I
> put
> in a Date and a Time, the subject of the letter or call and any other
> notes.
> Since I'm sending this letter out to all of my contacts I need to insert
> one
> record in the Calls table for each of the contacts in the Contacts table.
> The
> Date, Time, Subject and Notes all need to come from the form.
>
> How can I build an INSERT statement that will create one record in Calls
> for
> each record in Contacts and fill in the other four fields Date, Time,
> Subject
> and Notes from the form?
>
> I'm sorry this post is so long. I'm just trying to be clear. I appreciate
> everyone's help and don't want this to be as confusing for you as it is
> for
> me.
>
> Thanks
- Next message: Paul James: "Re: using VBA to print out lists of query tables and fields"
- Previous message: John Vinson: "Re: How do I do a Query with 3 joins?"
- In reply to: Scott Bridges: "Help with INSERT"
- Next in thread: Scott Bridges: "Re: Help with INSERT"
- Reply: Scott Bridges: "Re: Help with INSERT"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|