Forms, subforms and automatic update of the underlying table

G

Guest

Hello,
I am new to access development and VB code. I have an Access form based on
a parent table with 2 imbedded sub-forms from a second table. The subforms
display different data fields from the child table. The reason for 2 subforms
is that I can't display all the necessary fields on the form using a single
subform. In addition, I've used the datasheet view format for the subforms
so that users can see multiple records being added to the child table in
relation to a single record in the parent table. There is one ID field that
occurrs in both subforms.

My problem is that when I enter new data in the first subform, it doesn't
update the second subform until I go to a new record. If add data to the
second subform with out updating the table after entering in the first, it
results in extra records being added. I want to user to be able to enter
data in both subforms without having to manually update the record. Can I
use an event (e.g. after update) to automatically update the table so that no
duplication occurs when the user moves from one subform to the next for the
same parent record?

Thanks in advance!
 
R

Rick Brandt

BWR said:
Hello,
I am new to access development and VB code. I have an Access form
based on a parent table with 2 imbedded sub-forms from a second
table. The subforms display different data fields from the child
table. The reason for 2 subforms is that I can't display all the
necessary fields on the form using a single subform.

Better than two subforms on the parent then would be one subform which
itself has a TabControl on it so that you can do all the editing from one
form instance. Or else make the subform tall enough to hold everything and
include a scrollbar on the subform control of the parent. Having two forms
trying to edit the same table and records will usually cause write conflict
errors.
 

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