Add new record automatically

R

Rana

Hi,

I've got a couple of forms that all have a field "ROTAID' which is the
primary key for one of the tables and is linked to all the other tables. I've
created data entry forms for all these tables just to make it a bit more user
friendly. The primary form is 'Personal info. Primary' and like I said all
the other forms are linked to it. I want access to automatically insert the
new ROTAID into the other forms once I enter it in 'Personal info. Primary'.

Is there a simple way of doing that?
Any info./advice is highly appreciated.

Cheers,
Rana.
 
A

Arvin Meyer [MVP]

Creating a subform record with a linked subform. The only way to do it
without physically entering a record is to programmatically enter one. That
would mean that there would be meaningless records, which is a violation of
database Normalization rules.
 
T

tina

The primary form is 'Personal info. Primary' and like I said all
the other forms are linked to it.

the only way two forms can be "linked" is when one is loaded into a subform
control in the other as a subform object, and even then the forms are not
linked unless the LinkChildFields and LinkMasterFields properties of the
mainform's subform control are set appropriately. do you load "all the other
forms" into your primary form, in one or more subform controls?
I want access to automatically insert the
new ROTAID into the other forms once I enter it in 'Personal info.
Primary'.

you can't *insert* data into forms, because forms don't store data - tables
do. and you don't want to create an essentially blank (except for the
primary and foreign keys) record in every child table, each time you create
a record in the parent table.

after entering a record in the parent ("primary") table, you can use several
methods to add related records to any child table, as needed. one is the
mainform/subform method. another is a form bound to a child table, with a
combobox control bound to the foreign key field, with its' RowSource set to
the parent table, with the BoundColumn pointing to the parent table's
primary key field. still another way is to open the mainform and then open
another form (that is bound to a child table) in a separate window, again
with a couple different options on providing the primary key value of the
mainform's Current record to the child form, to be added to the foreign key
field in the child table.

the common factor in the above methods, and other not mentioned, is that the
primary key value of the parent table is not entered in a new record in a
child table *until you are actually entering a valid - if not entirely
complete - record in the child table.

hth
 
R

Rana

Thanx Tina. It seems like I can't actually do what I wanted to do.
No problem.

Cheers.
Rana.
 
R

Rana

Arvin, thank you for ur prompt response. I guess what I want to do cant be
done.

Thanx again.
Rana.
 

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