473,396 Members | 2,002 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Relating One Field in a Table to Multiple Fields in another Table

MS Access 97
Beginner/Moderate Level User

I am trying to create a Database to track Workouts in MS Access 97.

I have one Table named Workouts that contains the following Fields: Workout Code (e.g: U100), WorkoutActivity (e.g.: Bench Press: Flat Bench Straightbar) (note: this is the Primary Key of this Table), and Target Area (e.g.: Upper Body / Chest).

A second Table named Workout_Log contains the following Fields: Date, Set, WorkoutActivity, WorkoutActivity2..., Reps, and Weight..

I have created a Relationship between Table: Workouts: WorkoutActivity and Table: Workout_Log: WorkoutActivity, WorkoutActivity2. I've done this with the intent to automatically fill the Workout Code and the Target Area fields (derived from Table: Workouts) in on a new Form I'm creating relative to multiple WorkoutActivities (i.e.: WorkoutActivity, WorkoutActivity2...). The Form is being used to log multiple Workout Activities into a single Workout Session.

I have been successful in making the Form automatically popuate the Workout Code and Target Area fields based on selection from the WorkoutActivity field, but I am confused as to how to make the additional WorkoutActivity2 fields automatically drive the contents of additional Workout Code and Target Area fields.

Example:

Date: 09/19/06
Session: AM

Set Workout Code Workout Activity Target Area Reps Weight
1 U100 Bench Press Chest 8 180
2 <pending selection>

How do I cause the Workout Code & Target Area on this Form for Line #2 to automatically populate with "U101" and "Upper Chest" if I were to select "Bench Press: Incline" from the pending selection drop down box illustrated above? The way I have the Form set up now, the drop down does not trigger an autofill.

Thank you,
Shizbart
Sep 19 '06 #1
1 3021
MS Access 97
Beginner/Moderate Level User

I am trying to create a Database to track Workouts in MS Access 97.

I have one Table named Workouts that contains the following Fields: Workout Code (e.g: U100), WorkoutActivity (e.g.: Bench Press: Flat Bench Straightbar) (note: this is the Primary Key of this Table), and Target Area (e.g.: Upper Body / Chest).

A second Table named Workout_Log contains the following Fields: Date, Set, WorkoutActivity, WorkoutActivity2..., Reps, and Weight..

I have created a Relationship between Table: Workouts: WorkoutActivity and Table: Workout_Log: WorkoutActivity, WorkoutActivity2. I've done this with the intent to automatically fill the Workout Code and the Target Area fields (derived from Table: Workouts) in on a new Form I'm creating relative to multiple WorkoutActivities (i.e.: WorkoutActivity, WorkoutActivity2...). The Form is being used to log multiple Workout Activities into a single Workout Session.

I have been successful in making the Form automatically popuate the Workout Code and Target Area fields based on selection from the WorkoutActivity field, but I am confused as to how to make the additional WorkoutActivity2 fields automatically drive the contents of additional Workout Code and Target Area fields.

Example:

Date: 09/19/06
Session: AM

Set Workout Code Workout Activity Target Area Reps Weight
1 U100 Bench Press Chest 8 180
2 <pending selection>

How do I cause the Workout Code & Target Area on this Form for Line #2 to automatically populate with "U101" and "Upper Chest" if I were to select "Bench Press: Incline" from the pending selection drop down box illustrated above? The way I have the Form set up now, the drop down does not trigger an autofill.

Thank you,
Shizbart
-------------------------------------
You don't need the field work activity 2.
For each activity, you just create a new record. The date and set are enough to make the information unique. You can then report your acitivy based on grouping by date or set. If you have someone that does an activity more than once a day, you may want to also include a field for session number.
If you plan to use this log for different people, you will need another table with a list of the people and a unique id for each one. Just to start numbering them at one would work, or Access's field type 'autonumber' will ensure you don't use the same number over again.
Your acitiviy_log table will then also need to include the unique id of the person whose acitivity you are recording.
To maintain the activity_log, you would need a form and subform. The controlling form would be the people table and the subform would be the activity_log.
Microsoft Access web site has more info on how to create a form with a subform: http://office.microsoft.com/en-us/assistance/HP051878031033.aspx

jkantner
Sep 22 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Rick Caborn | last post by:
Does anyone know of a way to execute sql code from a dynamically built text field? Before beginning, let me state that I know this db architecture is built solely for frustration and I hope to...
3
by: BlackFireNova | last post by:
I have an existing database, and I need to add another table to it. The database tracks equipment, however I have a need to track ancillary items which are purchased or added to some of the...
2
by: Rooksarii | last post by:
Hello folks, Let me first apologize for any impropper terminology I may use as I am presently trying to broaden my Office knowledge by diving into Access head on. My specific problem is this....
4
by: Onion | last post by:
This has to be simple, but I'm forced to admit that I'm a novice who can't figure it out. I have a listbox in a form that allows multiple selections. That works fine. The problem: I can't...
7
by: Dabbler | last post by:
I'm using an ObjectDataSource with a stored procedure and am getting the following error when trying to update (ExecuteNonQuery): System.Data.SqlClient.SqlException: Procedure or Function...
2
by: David - Australia | last post by:
G'day from Australia, I'm hoping some bright spark may be able to help me with this one. I'm sure that it can be done, I've just hit a wall with it. So I'm opening it up. I'm storing student...
6
by: KevinPreston | last post by:
Hello everyone, this is my first post so apologies if i dont get it right first time, i am a self taught Access user, i am stuck on something i am trying to do, briefly i have 2 tables, one for...
1
by: jcocomo | last post by:
Hi there. I am quite new to MS-Access and databases in general, so please bear with me if this is a very basic question. I am trying to create a database in Access 2000 that will track patients as...
7
by: jsmith | last post by:
Hi. I have the following tables: StaffID (PK) LastName FirstName CMLID StaffID (FK) RAID (PK)
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.