Results 1 to 8 of 8
  1. #1
    William McKinley is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    59

    Add Multiple Records on One Form

    Hi All,



    I am trying to create a form for my supervisors to update their daily employee production hours. The supervisors have requested that all of their employees show up on one form, allowing them to simply tab down to the next person to add the employees daily hours. I've tried a few things but I am coming up short. Attached is the form design for my closest attempt. I added a bunch of different text boxes linked to the table that I want to populate with each 'User ID' field having a default value of each employee. The form looks the way I want it to when opened, however when I try to edit the first record it switches all of the fields to that particular employee. I guess it thinks all the text boxes are one record? I attached a few examples of how I need it to look and what happens when I try to add a record.

    Any ideas?

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    the continuous form is perfect for this type of thing. try using it

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    It appears that it is a continuous form. I'd be curious what the table structure is. It looks like employees are fields instead of records, which would be a normalization mistake.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    William McKinley is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    59
    I'm sure the table structure is where my error is occurring. In order have multiple records appear at one time, I duplicated all of the fields to include a default value for each Employee ID. I'm about 99% sure that this is wrong, but I'm not sure how to have each of the Employee ID's appear otherwise. Attached is a picture of the table structure.

    Edit: This is as close as I can get. Instead of showing past records, I would like each of these employee values to show up as default values for new records. I guess what I am really trying to figure out is how I can have 17 new record fields as opposed of the default one record field.
    Last edited by William McKinley; 08-14-2010 at 10:14 AM. Reason: Additional Information

  5. #5
    William McKinley is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    59
    Well it isn't necessarily the best solution, but with next to zero coding knowledge it'll do. I created a combo box containing each employee I would like to log production hours for. Next, I created an On Load event procedure to create new records for each employee for the shift.

    Code:
    DoCmd.GoToRecord acForm, "My Table", acNewRec
    Me.MyCombo = MyCombo.Column(0, 0)
    I used =()Date as the default value of the Date field to save unnecessary keying.

    Unfortunately this required me to make a form for each shift, but I can live with that. Another unfortunate side effect is the form creating records each time the form is opened. If the supervisors think they messed something up, close and reopen the form, I get a whole new set of records for the day.

    Any ideas how to automatically delete those when the form closes?

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    I have a couple of applications where for the ease of data entry people, I pre-populate a table as they open a form (using an append query). It creates an entry for every possible rate a driver could have for the day. Your equivalent would be a record for every employee. When the form closes, I run a delete query that deletes any record where the hours are 0.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    William McKinley is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    59
    Quote Originally Posted by pbaldy View Post
    I have a couple of applications where for the ease of data entry people, I pre-populate a table as they open a form (using an append query). It creates an entry for every possible rate a driver could have for the day. Your equivalent would be a record for every employee. When the form closes, I run a delete query that deletes any record where the hours are 0.

    Works like a charm. Thanks for the help.

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Happy to help.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 15
    Last Post: 10-01-2015, 10:06 AM
  2. Replies: 47
    Last Post: 06-17-2010, 03:04 PM
  3. Create multiple records with 1 form?
    By bergjes in forum Forms
    Replies: 4
    Last Post: 04-14-2010, 06:16 AM
  4. Trying to create multiple records from a form
    By ed_hollywood in forum Forms
    Replies: 4
    Last Post: 04-02-2010, 10:57 PM

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