Can you create 1 form to save to 2 tables?

Naia

Registered User.
Local time
Today, 00:00
Joined
Apr 6, 2007
Messages
24
I want to create one form that can save to two different tables without using a subform. I can get all the fields to appear on the form but get a variety of errors:

Errors in design view
Invalid Control Property: Control Source
No Such field if the field list

Errors in after using a wizard to create the form:
The wizard is unable to open your form in Form View, possibly because another user has a source table open in exclusive mode. Your form will be opened in design view.

Error trying to open the form:
Type mismatch in expression

Thanks, Naia
 
The only way to bind the form to 2 tables would be to bind it to a query that included both tables. However, the specifics of the tables could cause that query to be non-updatable, thus preventing you from doing anything other than viewing the data. More info here:

http://support.microsoft.com/default.aspx?scid=kb;en-us;328828
 
One way you can update multiple tables is to use an unbound form and use DAO or ADO to update the tables.
 
Im facing a similar problem to yours.

In my case i have a form with a table and a save button and i need one of the fields of this form to be also added to another table and vice versa (if you delete the product here, delete it also on the other table)

What i have right now is a normal form with a save button, and have included a function to the save button to make the insertion/update to the other table..and that's were i have the problem.

If you want you can check my topic with this problem, and see the latest post..it might help you.

http://www.access-programmers.co.uk/forums/showthread.php?t=157952

Hope a solution can be found sooner now that there is another member with the same problem.

Best regards
 
I think i solved my problem with this..

sql = "SELECT idProduto FROM Stock WHERE idProduto= " & idProduto & ";"
rec.Open sql, con
If rec.EOF Then
sql2 = "INSERT INTO Stock (idProduto) VALUES ('" & idProduto & "');"
db.Execute (sql2)
End if

Hope it helps you..
 

Users who are viewing this thread

Back
Top Bottom