Control on form to copy fields to another table

D

dscully

I'm using Access 2000 and I would like to add a control to
a form to copy three fields from that record to an
unrelated table. Is this workable?

Is there a way to modify the following SQL statement:
INSERT INTO tblChanges ( [Journal Title], URL, [Date] )
SELECT tblJournals.Title, tblJournals.URL, tblJournals.
[Date Added]
FROM tblJournals;
so that it only applies to the current record, or is it
best done with VBA?

I'm very much groping through the dark with SQL and VBA,
so any help would be appreciated.

dscully
 
J

John Vinson

I'm using Access 2000 and I would like to add a control to
a form to copy three fields from that record to an
unrelated table. Is this workable?

Is there a way to modify the following SQL statement:
INSERT INTO tblChanges ( [Journal Title], URL, [Date] )
SELECT tblJournals.Title, tblJournals.URL, tblJournals.
[Date Added]
FROM tblJournals;
so that it only applies to the current record, or is it
best done with VBA?

Sure... let's say your form is named frmChanges and that URL is a
unique ID in tblJournals (if it's not you'll need such a field); and
that there's a textbox on frmChanges bound to URL and named txtURL:

INSERT INTO tblChanges ( [Journal Title], URL, [Date] )
SELECT tblJournals.Title, tblJournals.URL, tblJournals.
[Date Added]
FROM tblJournals
WHERE = Forms![frmChanges]![txtURL];
 
M

Mike Painter

dscully said:
I'm using Access 2000 and I would like to add a control to
a form to copy three fields from that record to an
unrelated table. Is this workable?

Is there a way to modify the following SQL statement:
INSERT INTO tblChanges ( [Journal Title], URL, [Date] )
SELECT tblJournals.Title, tblJournals.URL, tblJournals.
[Date Added]
FROM tblJournals;
so that it only applies to the current record, or is it
best done with VBA?

I'm very much groping through the dark with SQL and VBA,
so any help would be appreciated.

dscully
If you are working from a form then
INSERT INTO tblChanges ( [Journal Title], URL, [Date] ) VALUES Me!Title,
Me!URL, Me! [Date Added];

This is found under contents/MSFT Jet SQL/data manipulation language In
Access help.

Looking up Insert into in Access or VBA help doesn't help.
 
G

Guest

-----Original Message-----
If you are working from a form then
INSERT INTO tblChanges ( [Journal Title], URL, [Date] ) VALUES Me!Title,
Me!URL, Me! [Date Added];

This is found under contents/MSFT Jet SQL/data manipulation language In
Access help.

Looking up Insert into in Access or VBA help doesn't help.



.
Thanks. The help file doesn't actually work anyway.
(Four weeks after IT insisted on upgrading to Access 2000
and I'm still waiting for them to install it _properly_)

dscully
 
J

John Vinson

Thanks. The help file doesn't actually work anyway.
(Four weeks after IT insisted on upgrading to Access 2000
and I'm still waiting for them to install it _properly_)

We're still waiting in Access2003 for Microsoft to implement the Help
file properly. <GRUMP>

In other words, don't blame IT for all the problems with Access Help.
Microsoft really screwed it up with the release of 2000 and it's
better, but not fixed yet.
 

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

Top