Multi information

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can anyone give me a help on this:

I would like to create database for yoga poses. Every pose contains some
cautions which every caution is suggested to practice some poses. How can I
create tables for them, so that I am able to read all the information when I
choose a pose or a caution. Thanks.
 
A main table for the poses, a table for cautions, and a junction table since
each Pose can have many Cautions and each Caution can be associated with
many poses.

tblPose
PoseID (autonumber primary key)
PoseName

tblCaution
CautionID (autonumber primary key)
CautionDescription

tblPoseCaution (junction table)
PoseCautionID (autonumber primary key)
PoseID_PC (foreign key to tblPose)
CautionID_PC (foreign key to tblCaution)

Designate the primary key (PK) fields in table design view. When you set up
the foreign key fields, set their Data Type to Number (Long Integer). Do
not attempt to designate them as foreign key fields.

Click Tools > Relationships. Add all three tables. Drag PoseID on top of
PoseID_PC. Click Enforce Referential Integrity when the dialog appears.
Repeat for CautionID and CautionID_PC. Save and exit.

Create a form based on tblCaution to enter the list of Cautions. It may be
simplest to set the default view of the form to Continuous.

Create a form (frmPose) based on tblPose. Set its default view to Single
Form.

Create another form (fsubPoseCaution) based on tblPoseCaution. Set its
Default View to Continuous. Use the combo box wizard to add a combo box (in
the toolbox, be sure the magic wand icon is highlighted, click the combo box
icon, and double click on the form). Choose the Look up the values option,
select tblCaution, add both fields, sort by the Caution field, accept the
recommendation to hide the key column, select Store the value... and select
CautionID_PC, change the caption as needed and click Finish. Note: Click
Next between each step listed in the previous sentence.

With frmPose open in design view, drag the icon for fsubPoseCaution onto it
(press F11 if you don't see the database window, which is the listing of
tables, queries, etc.). This creates a subform. Click the very edge of the
subform, click View Properties, and be sure the Link fields show PoseID and
PoseID_PC. If they do not, click the three dots next to one of the Link
properties. It should set it up for you.

These are the bare minimum fields. Add others as needed.
 

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

Back
Top