Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2003
    Location
    Winnipeg, MB, CA
    Posts
    16

    Question Unanswered: Help me with sub-forms?

    *** I am having a different problem, please read my most recent post at the bottom ***

    //I am still making the vacation request tracker, but trying it a different way. I've got a table holding the employees' names, one that holds employee name, year and month, and a table that holds name, year, month, day.

    I've got the lowest table (days) made into a datasheet form,
    the 2nd lowest (months) made into a columnar form with the days form as its subform,
    and the highest table (employees) made into a columnar form with the months form as its subform.

    My question is how can I set up the employees form so that you can select the employee's name (hopefully via drop-down menu) then type in the year and month in the first subform, then type in a bunch of days in the datasheet in the subform of the subform?

    -d3rt
    Last edited by d3rt; 10-15-03 at 18:10.
    __________________________
    We can send a man to the moon,
    but heaven
    help us to weld vertices properly.

  2. #2
    Join Date
    Sep 2003
    Location
    Brazil
    Posts
    3

    Re: Help me with sub-forms?

    Hi!

    Try this:

    Forms![Your_Form]![Subform Your_SubForm]![Your_subform's_control]

    [ ]s LuCa

  3. #3
    Join Date
    Oct 2003
    Location
    US
    Posts
    343

    Re: Help me with sub-forms?

    Its very eacy if you have set primary and foreign keys properly. The way it should work is "employees" has a one to many relationship with "months" and "months" have a one to many relationship with "days".

    With that in place, create a form based on "employees". Create another form based on "months" and another based on "days".

    Now in your subform "months", place a subform control using the wizard and put your "days" subform in here.

    then in your main form "emplyees", place a subform control using the wizard and place the "months" subform.

    Hope that'll help


    Originally posted by d3rt
    I am still making the vacation request tracker, but trying it a different way. I've got a table holding the employees' names, one that holds employee name, year and month, and a table that holds name, year, month, day.

    I've got the lowest table (days) made into a datasheet form,
    the 2nd lowest (months) made into a columnar form with the days form as its subform,
    and the highest table (employees) made into a columnar form with the months form as its subform.

    My question is how can I set up the employees form so that you can select the employee's name (hopefully via drop-down menu) then type in the year and month in the first subform, then type in a bunch of days in the datasheet in the subform of the subform?

    -d3rt

  4. #4
    Join Date
    Oct 2003
    Location
    Winnipeg, MB, CA
    Posts
    16
    okay, I've dumbed this down for simplicity

    I now only have an employees table (with just the employee's name field) and a day table (with the name, date, and comment fields)

    Employee's name (first table) is in a one-to-many with name (second table).
    I made a query from the second table with all fields (name, date, comment).
    I made a form from that query and put it in data sheet view.
    Then I made a form out of the first table and used the form that I made out of the query as the sub-form.

    It almost works.

    Firstly, when I try to enter a new date for an employee, it says it is read-only. I press okay, and the letter I just typed is in the box. It will let me keep typing. This isn't much of a problem, but a huge annoyance.
    *** This only happens for the first date entered for each employee, not for that session, but the first ever for that employee ***

    Second, I can't seem to hide the employee name from the datasheet in the subform, so I get a bunch of redundancy (a column that says name at the top, and has the person's name printed all the way down), merely setting visible to no does not work.

    Third, how do I get the calendar control to work on a datasheet?
    Last edited by d3rt; 10-15-03 at 18:11.
    __________________________
    We can send a man to the moon,
    but heaven
    help us to weld vertices properly.

Posting Permissions

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