Not sure if you can do it in Access in one statement. I think I would
insert into USERS and a intermediary table and then insert iton Wages based
on the content of the intermediary table. If you could use SQL ~Server then
it would be easier. You could create an SP which inserts into USERS and
then interrogate the system table INSERTED (I assume you are using SQL).
This will contain all of the records you have inserted in to USERS which
will include the ID so you can then perform an insert into wages.
A much better aprocach would be to create an updateable view combining these
2 tables and insert into the view (I think this works but I'm not sure.)
If I'm way off the mark sorry!!
Andy
------------------------------------------------------------------
Andrew Ewings
Project Manager
Thoughtbubble Ltd
http://www.thoughtbubble.net
------------------------------------------------------------------
United Kingdom
http://www.thoughtbubble.co.uk/
Tel: +44 (0) 20 7387 8890
------------------------------------------------------------------
New Zealand
http://www.thoughtbubble.co.nz/
Tel: +64 (0) 9 419 4235
------------------------------------------------------------------
The information in this email and in any attachments is confidential and
intended solely for the attention and use of the named addressee(s). Any
views or opinions presented are solely those of the author and do not
necessarily represent those of Thoughtbubble. This information may be
subject to legal, professional or other privilege and further distribution
of it is strictly prohibited without our authority. If you are not the
intended recipient, you are not authorised to disclose, copy, distribute, or
retain this message. Please notify us on +44 (0)207 387 8890.
-----Original Message-----
From: Simon Halcrow [mailto:[EMAIL PROTECTED]]
Sent: 24 October 2000 13:53
To: CF-Talk
Subject: RE: SQL INSERTs across multiple related tables
Hi Anthony
Nope - tried the
INSERT INTO Users
INNER JOIN Wages
ON Users.User_ID = Wages.User_ID
(Users.Surname, Wages.NINumber)
VALUES ('Bloggs', 'NY012398B')
before. All I get is:
ODBC Error Code = 37000 (Syntax error or access violation)
[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO
statement.
Surely, there's an easier way?!
Thanks.
Sapphire Technologies Ltd.
Secure in the Knowledge
Simon Halcrow Web Developer
E [EMAIL PROTECTED]
T +44 (0)1642 702100
F +44 (0)1642 702119
W www.sapphire.net
-----------------------------------------------
Any opinions expressed in this message are those of the individual and not
necessarily the company. This message and any files transmitted with it are
confidential and solely for the use of the intended recipient. If you are
not the intended recipient or the person responsible for delivering to the
intended recipient, be advised that you have received this message in error
and that any use is strictly prohibited.
Sapphire Technologies Ltd
http://www.sapphire.net
----------------------------------------------------------------------------
--------------------
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a
message with 'unsubscribe' in the body to [EMAIL PROTECTED]
------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message
with 'unsubscribe' in the body to [EMAIL PROTECTED]