Results 1 to 7 of 7
  1. #1
    4 Star Lounger
    Join Date
    Apr 2001
    Location
    Guatemala City
    Posts
    515
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Creating data via sub-form. (Win XP Access 2003)

    This routine creates an exercise routine for a member of a gym.

    I open a form/sub-form which contains ID information from tblPersonnalData in the main form and information from tblRoutinas in the sub. The first time a member opens a routine, I want to be able to select from three pre-extablished routines. When I leave the form, the routine is saved in tblRoutinas. As time goes by, I return and modify the routines from the same form.

    As it stands now, I open the form, pick a member from an option box, fill out the routine, print it, and leave. That creates the routine record in tblRoutines, but it takes a long time.

    tblRoutines uses an AutoNumber as it's ID.

    Can you give me some approaches? Thanks.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Creating data via sub-form. (Win XP Access 2003)

    Are the pre-established routines stored in a table? If so, what is its name?

  3. #3
    4 Star Lounger
    Join Date
    Apr 2001
    Location
    Guatemala City
    Posts
    515
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Creating data via sub-form. (Win XP Access 2003)

    I am coming to that conclusion as I struggle with this. If I create the three new tables, let's say tblPrin, tblInter, tblAdv, than I could use the AddNew method to create the different routines. I would have to set up some option to select the correct table. Not very elegant, but I could set up three command buttones to run three different copies of the code (with the correct table in each instance).

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Creating data via sub-form. (Win XP Access 2003)

    If possible I would use one table, with an indication of the level, but you haven't provided any information about the routines, so it's hard to give advice.

  5. #5
    4 Star Lounger
    Join Date
    Apr 2001
    Location
    Guatemala City
    Posts
    515
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Creating data via sub-form. (Win XP Access 2003)

    From a main menu, I go to frmRutinas. The main form comes from tblPersonalData - name, ID, basically. There currently I fill out the subform, based on tblRutinas, with the individual exercises, frequency, weights, etc, maybe 8 to 15 different exercises, each one creating a register in the tblRutinas for the member specified in the main form.

    That is where I plan to select male or female, beginner, intermediate or advanced, with a different table for each of the six options.

    My thoughts were to create a table for each option. Then I would select from maybe an option box to get the male or female part, then another option box to get the levels. In the AddNew routine I would use case conditions to change the table to be used.

    What are your thoughts on this? What is the best way to make the selection among the six options?

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Creating data via sub-form. (Win XP Access 2003)

    I still think you should create one table to hold the pre-established routines. This table would have fields such as:
    - Level (beginner, intermediate, advanced)
    - Gender (male, female)
    - Excercise
    - Frequency
    - ...

    I would use a separate form for entering the data for a new member. This form would have an option box or combo box to select the level and another one to select the gender. The form would also have an "OK" or similar button; this button would run an append query that selects the records from the pre-established routines table for the appropriate level and gender, and append them to tblRutinas, while setting the ID for the new member.
    When you open main form/subform combination, the appended records will automatically be displayed in the subform for the new member.

  7. #7
    4 Star Lounger
    Join Date
    Apr 2001
    Location
    Guatemala City
    Posts
    515
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Creating data via sub-form. (Win XP Access 2003)

    The routine has been working since yesterday with no problems. Thank you.

    Do you guys realize how much you help?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •