Results 1 to 5 of 5
  1. #1
    darantares is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Posts
    2

    Indefinite fields on the same record?

    Being new to access, I think I've come a long way over the past week or two in creating a database from the ground up. However, I've hit a snag.

    What the database is doing is tracking user exercises. Initially, I had a table called exercises, and a field for exercise 1, exercise 2 and exercise 3. The database user goes to the exercise form and enters the name of the 1-3 exercises. That works exactly like it should.

    I want to know if a user can input an indefinite number of exercises. Sometimes they might do 1 exercise, sometimes 3. I thought about making 10 fields for exercises, but what happens if they do 11? or 20? I don't want to add another row because each row now has the people doing the exercises. Like Jon day 1 might be Row 1, Sam day 1 will be Row 2, Jon day 2 will be Row 3, etc. Each day they do the exercises adds a new row to the table (and that part is working too).



    So what I'm asking is if you can put a + button or something on the forum and have it automatically add another field to that record. I've tried looking in the book I have, as well as Googling, and I haven't found anything close. Thanks for the assistance.

  2. #2
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    Do not know if I have understood things properly ?
    What tables do you have ?
    The way I see it :
    The tables :

    tblUsers

    UserID - PK
    UserName
    .......

    tblExercises
    ExerciseID - PK
    ExerciseName
    .....

    tblUserExercisesRecords
    UserExerciseID - PK
    UserID - FK
    ExerciseID - FK
    ExerciseDoneDate
    .....

    Thanks

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848

  4. #4
    darantares is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Posts
    2
    Quote Originally Posted by recyan View Post
    Do not know if I have understood things properly ?
    What tables do you have ?
    The way I see it :
    The tables :

    tblUsers

    UserID - PK
    UserName
    .......

    tblExercises
    ExerciseID - PK
    ExerciseName
    .....

    tblUserExercisesRecords
    UserExerciseID - PK
    UserID - FK
    ExerciseID - FK
    ExerciseDoneDate
    .....

    Thanks
    Only two tables. The user one, and the exercises one. Perhaps a picture will help

    Click image for larger version. 

Name:	table.jpg 
Views:	6 
Size:	66.3 KB 
ID:	9399

    The user enters what exercises they do, so those exercises are not pulled from a database. As you see in the pictures, there is Exercise_Activity_1, Exercise_Paramaters_1 and then Exercise_Comments_1, and then 2, and then 3.

    Here is the form where they enter the data (rough draft)

    Click image for larger version. 

Name:	form.jpg 
Views:	5 
Size:	69.1 KB 
ID:	9400
    What I want to know is if we add 4 or 5 exercises can a user add additional exercise (more than the 3 shown) and those will be stored in the table, as Exercise_Activity_4, and so on.

    I looked over the normalization stuff, but I don't think that's what I'm trying to do. I could be wrong, but that looked more like linking tables and such.
    Attached Thumbnails Attached Thumbnails table.jpg  

  5. #5
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I looked over the normalization stuff, but I don't think that's what I'm trying to do. I could be wrong, but that looked more like linking tables and such.
    Normalization is exactly what you need.

    Another site is "Access Basics By Crystal"
    http://www.accessmvp.com/Strive4Peace/


    At a minimum, I see tables:
    Code:
    tblPatients
    PatientID - PK
    NameFirst
    NameLast
    .......
    
    tblExercises
    ExerciseID - PK
    ExerciseName
    .....
    
    tblPatientExercises
    PatientExercisesID  - PK
    UserID - FK
    ExerciseID - FK
    ExerciseDoneDate
    ExerciseActivity
    ExerciseParameters
    ExerciseComments

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 08-10-2012, 09:37 AM
  2. Replies: 4
    Last Post: 09-29-2011, 09:12 AM
  3. Clear fields in a record
    By stryder09 in forum Access
    Replies: 9
    Last Post: 05-12-2011, 01:34 PM
  4. 2 fields the same in a record
    By joeldamole in forum Queries
    Replies: 1
    Last Post: 03-08-2011, 07:04 AM
  5. Replies: 0
    Last Post: 02-25-2011, 09:40 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums