Design approach question

D

Darryl

I have a table called table1. I also have a tabled called table2. Table1
and Table2
ahave 1 field in common called qkey. I have set a relationship between
table1 and table2
based on qkey.

I want to have a single form for entering/modifying data in table1 & table2.
So, I enter the
data for table1 using the form. I enter the data for a record in table2
using the same form (at
the same time). When I save, the record is saved in table2 (qkey is an
autogenerated). Then
the qkey field is set to the value from table2.

pointers on how to do this (or a link to a tutorial, etc) would be much
appreciated.

-Darryl
 
A

Albert D.Kallal

The scenario you describe is as common as trying to center text in a word
processor!!

If you build a sub-form, and set the link master/child fields, then
ms-access will do all of the field setting for you.

This assume that the primary key field in table 1 is a autonumber.

The field used to "relate" table2 back to table one obviously needs a field,
this field qkey in table 2 needs to be a REGULAR non autonumber field.

If you got the above relationship setup, then you can use the wizard to
"add" table2 to form, and you need not write one line of code.

So, as a "general" rule, you use a sub-form to handle the "many" side.

So, just use the wizard to create a form for table1

Then, on form 1, use the tool bar (with the wizard) to add a sub-form, and
that sub-form will be based on table 2....

Sub-forms are rather nice, and a great way to display the "many" side. Here
is neat-o screen shots of sub-forms:

http://www.members.shaw.ca/AlbertKallal/Articles/Grid.htm

And, here is a explain of what sub-forms are all about:

http://www.members.shaw.ca/AlbertKallal/Articles/fog0000000005.html
 
D

Darryl

I'm having a brain fart this morning. How do you have a grid to display the
table
contents (like in first example on right side where a subform was placed
with grid).

thanks
Darryl
 
A

Albert D.Kallal

You just change the view of the form to datasheet mode, or continues form
mode.

The latter "continuous" form mode requites you to layout the fields (but,
that is usually what I want).

You just place (or shall I say build) the detail line by placing what
controls you want. So, you can drag the LastName, and company name


You get

LastName CompanyName


You want to re-size the detail section as "narrow" (small) as a possible.
Now flip the form in to continues form view....

The beauty continues forms is that you get all the features of a regular
form, but as those screen shots show, everything repeats for you, even
buttons if you place them in the details section....
 

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

Similar Threads


Top