| View previous topic :: View next topic |
| Author |
Message |
nickt1988 Newbie

Joined: 17 May 2010 Posts: 4
|
Posted: Mon May 17, 2010 6:12 am Post subject: creating subforms |
|
|
Hey people,
I'm new to openoffice but not databases. I'm proper stuck on subforms. I'm currently working on a database to record my bodybuilding exercises.
Heres my table structure:
tblWorkout
Workout_ID - Integer - primary key
Date - date
Current Weight - integer
tblExercise
Exercise_ID - integer - primary key
Exercise - text
Workout_ID - integer - foreign key
tblSets
Sets_ID - integer - primary key
Sets - integer
Workout_ID - integer - foreign key
tblReps
Reps_ID - integer - primary key
Reps - integer
Workout_ID - integer - foreign key
tblSetWeight
SetWeight_ID - integer - primary key
SetWeight - integer
Workout_ID - integer - foreign key
Relationships:
So the form i want to make will have a main form containing the tblWorkout Fields, and have a subform in datasheet view containing these fields: exercise, sets, reps, and setweight, however i want the fields to be like list boxs so i can select the data for that session.
So i go to the wizard and select the first table, but then when i go to make the subform i can only select one table at a time, and therefore am getting stuck with how to get the other fields into my database.
I'm proper lost with what is wrong, any help would be amazing!
Thanks[/img] |
|
| Back to top |
|
 |
RPG Super User

Joined: 24 Apr 2008 Posts: 2696 Location: Apeldoorn, Netherland
|
|
| Back to top |
|
 |
nickt1988 Newbie

Joined: 17 May 2010 Posts: 4
|
Posted: Mon May 17, 2010 10:03 am Post subject: |
|
|
So i've had a look at that post and created a subform which is pointed to the same as the main form and then in the subform i have created more subforms for the different tables.
Picture so this makes sense:
So now my form looks like this:
the problem now is that the Exercise form saves whats selected but the other three don't save.
The master and slave fields for all the sub-subforms is Workout_ID.
Any ideas on what i've done wrong? |
|
| Back to top |
|
 |
RPG Super User

Joined: 24 Apr 2008 Posts: 2696 Location: Apeldoorn, Netherland
|
Posted: Mon May 17, 2010 12:11 pm Post subject: |
|
|
Hello
I think the most important error you make is: It seemes that you have the idea that a subform is a graphical idea andt hat is not true.
Make a subform with the wirzards and sea what it is.
Romke |
|
| Back to top |
|
 |
nickt1988 Newbie

Joined: 17 May 2010 Posts: 4
|
Posted: Mon May 17, 2010 1:00 pm Post subject: |
|
|
| help me out then |
|
| Back to top |
|
 |
RPG Super User

Joined: 24 Apr 2008 Posts: 2696 Location: Apeldoorn, Netherland
|
Posted: Mon May 17, 2010 1:06 pm Post subject: |
|
|
| No |
|
| Back to top |
|
 |
nickt1988 Newbie

Joined: 17 May 2010 Posts: 4
|
Posted: Mon May 17, 2010 1:22 pm Post subject: |
|
|
| prick |
|
| Back to top |
|
 |
keme Moderator


Joined: 30 Aug 2004 Posts: 2744 Location: Egersund, Norway
|
Posted: Mon May 17, 2010 1:48 pm Post subject: |
|
|
Refrain from name calling, and instead make use of the link provided. It really is helpful.
The forum thread has a section about creating main-/subforms. Read the entire thread, and bear in mind the two "form concepts" mentioned: the graphical form as a set of fields laid out on screen, and the logical form (consisting of the set of form fields connected to the main table fields) and subform(s) (set(s) of form fields connected to dependent table fields). The logical main form and subforms are all contained within one graphical form document.
Once you master those concepts, find your way around the form navigator, and in particular gain control of the subform properties for linking to the main form data, you're well on your way. |
|
| Back to top |
|
 |
|