form update 2 tables

Don White

Spider
Local time
Yesterday, 21:50
Joined
Jan 6, 2005
Messages
17
I have one form with fields from 2 tables. When I add a new record I want it to add a new record to both tables. Each table has a field name called "Groupname". After click on the add record, it clears all fields in the form just like it should. Then I populate the fields with data and when I a finished it should add a new record to both tables. The first table fields are updated correctly. The second table the Groupname field does not have anything in it. It should have the same name as in the first table.

Both tables use the same name. How do I get the name in the second table?

I have a sample db to show the problem. How do I send it?
 
Last edited:
I'm kinda more interested in why you would do this. There are potentially valid reasons, but they are rare.

Explain the problem a little more.
 
zip the file and scroll down on your reply screen and you'll snd manage attachments - thats how you attach - size restictions apply

as to why you want to do this - seems a bit iffy to me , usually you would have PK and FK
prime keys and foreign keys to cross refer so you don't have duplicates field values - but occasionly there is a need to deviate from this - but 95% what you are doing is wrong ...
 
I have 2 tables and when I add a record to one table I want the second table updated also with the same control (groupname in my sample). Duplicate field is only the prime key. This in my mind is very common. If the groupname is 1111 the second table I want the prime key to be 1111. So when I want to query and get all matching data I will be able to do so.
 
Two tables -

1 main form, 1 subform (linked by the key field in the Master/Child links) or 1 unbound main form and 2 subforms (1 for each table) and linked by the ID field via a text box on the main form.
 

Users who are viewing this thread

Back
Top Bottom