473,699 Members | 2,628 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

1 New Member
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 , WorkoutActivity 2..., Reps, and Weight..

I have created a Relationship between Table: Workouts: WorkoutActivity and Table: Workout_Log: WorkoutActivity , WorkoutActivity 2. 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 WorkoutActiviti es (i.e.: WorkoutActivity , WorkoutActivity 2...). 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 WorkoutActivity 2 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 3044
jkantner
7 New Member
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 , WorkoutActivity 2..., Reps, and Weight..

I have created a Relationship between Table: Workouts: WorkoutActivity and Table: Workout_Log: WorkoutActivity , WorkoutActivity 2. 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 WorkoutActiviti es (i.e.: WorkoutActivity , WorkoutActivity 2...). 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 WorkoutActivity 2 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.microsof t.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
6202
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 make it better soon. Unfortunately, there is never a non-crucial time in which we can do an upgrade, so we are stuck for now. Point 1: There are multiple tables: students, courses, cross-reference
3
4484
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 equipment separately. In the existing table there is a serial number field, which is indexed with no duplicates. In the new table there will be multiple entries which must be related to the individual piece of equipment which is entered in the...
2
2417
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. I have a field in one of my tables that references a value in another table via a list box. Next to it, instead of manually creating another list box to go along with it, I would like to have this other field acknowledge that the value in it's...
4
2350
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 figure out how to store the data. I want to store the items chosen from the listbox in a field for the current record. That means the table field must store the variable number of text items selected from the listbox by the user.
7
3457
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 'UpdateRegistrant' expects parameter '@EMail', which was not supplied. The field value was null in the database and not changed in the FormView so is null going back into the stored procedure. I'm stumped and would greatly appreciate any suggestions.
2
4794
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 competencies for a given number of performance criteria (which are stored in a separate reference table). Students are rated competent or not (yes/no field) on up to 5 assessments - Task, Observation, Project, Practical Test, Exam for
6
5854
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 vehicle details and one for inspection details of vehicles in the first table. I have 2 fields that are the same in both tables, lastsafe and distance, the vehicles table can only have 1 vehicle to each record, the inspection table can have multiple...
1
1431
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 they move from room to room in a hospital setting. I have a table for patient demographics, called “Patients”, one for room numbers and information, called “Rooms”, and one for information on movements from room to room, called “Movement.”...
7
3924
by: jsmith | last post by:
Hi. I have the following tables: StaffID (PK) LastName FirstName CMLID StaffID (FK) RAID (PK)
0
8687
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8617
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9174
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9035
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8914
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7751
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6534
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4629
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3057
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.