1 form 2 tables - MS ACCESS

2019-08-04 17:17发布

Is there a way to set up 1 form to populate 2 tables? But I would like any subsequent changes to the second table to be completed via another form.

Is this possible?

2条回答
该账号已被封号
2楼-- · 2019-08-04 18:03

If the tables are related to each other, set up a Relationship between the two (click on Tools, and then Relationships in A2003) and set the relationship to Enforce Referrential Integrity.

If the tables are unrelated, then you will have to use a query or write some VBA code to populate both tables, and run them through a form-related event (OnClick for a button, or OnLostFocus if you want the query/VBA to run automatically when the user moves off a specific textbox).

查看更多
在下西门庆
3楼-- · 2019-08-04 18:10

Yes it is possible. Depending on how you want to accomplish the updating of table B, there are two possible ways that would be the easiest. The easiest is to make an Update Query that would be run depending on when you want the query to run, i.e. after an update of a field or when closing the form etc. The second way is to create a recordset of the records from Table B in VBA code to update the field. Either way will work equally well and becomes a matter of individual preference.

查看更多
登录 后发表回答