By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,905 Members | 1,756 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,905 IT Pros & Developers. It's quick & easy.

Access Sub Forms

P: n/a
Hello All

I am trying to build a couple of forms in Access 2000. Whilst I have
one form which has all of the contact details in it also generates
(using autonumber) a unique id for the customer.

I have also created a button to open up another form which looks at a
second table. I want the ID automatically populated into the form
(tables are designed one to many) so that correspondence can be added.
At the moment access states that data needs to be inserted into the
clients table before data can be inserted into the correspondeance
table.

A subform has been successfully created using the button on the tools
menu but it embeds it within the existing form. However, it does throw
in the CustID automatically!

I've tried creating a separate form and linking the custID which is
primary to the foreign key custID in the corres table but it still
gives me the jip! Any ideas would be truly appreciated since I am new
to access and need to get something up and running sharpish!

Thanks in advance

Simon
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Answers interspersed:

"Simon" wrote
I have also created a button to open
up another form which looks at a
second table. I want the ID auto-
matically populated into the form
(tables are designed one to many) so
that correspondence can be added.
At the moment access states that data
needs to be inserted into the clients
table before data can be inserted into
the correspondeance table.
And that is a _good_ thing, because it will keep you from, eventually,
having to worry about all the "orphan records" in the related tables. All
you have to do is to _explicitly_ save the record before opening the second
form and passing the ID, as:

DoCmd.RunCommand acCmdSaveRecord
A subform has been successfully created
using the button on the tools menu but it
embeds it within the existing form.
Actually, Access has nothing known just as "subform". It does have a Subform
Control (which, by definition, has to be embedded in a Form). You then embed
a Form in the Subform Control.
However, it does throw
in the CustID automatically!


And, the Boys and Girls in Redmond thought ahead as to how a Form embedded
in a Subform Control might be used -- realizing it might well be used to
enter new Records in related Tables, they opted to save the record on the
parent Form when you move from the Parent to the Form in the Subform
Control.

So, you can either do the explicit Save, or use the Subform Control --
whichever you prefer.

Larry Linson
Microsoft Access MVP
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.