Results 1 to 8 of 8
  1. #1
    taliorn is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2016
    Posts
    11

    Using a Form to create multiple records in a table

    I'm working on building a Training Database for my work. I have a table with Required training for each position.



    Set up in such that: Position A needs training 1
    Position A needs training 3
    Position B needs training 1
    Position B needs training 2 so on and so forth...

    Certain positions can need up to 20 or more trainings so this could be time consuming to enter each one by hand plus future updating would be a chore.

    Is there a way to create a form where I select the position and then I check mark the required trainings and this updates my table?
    Attached Thumbnails Attached Thumbnails Training Form.png  

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    A multiselect listbox would be one way:

    http://www.baldyweb.com/MultiselectAppend.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    taliorn is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2016
    Posts
    11
    That looks like what you I am talking about.

    I'm learning a lot more I don't know as I go along.

    I would add the code to an action button that would create the data entry into the table correct?

    The other question is it possible to make the multiselect box have check boxes? It would likely make it easier to use.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Typically you would put the code behind a button, yes. Offhand I don't know how to use checkboxes instead. To me, the listbox is intuitive.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    taliorn is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2016
    Posts
    11
    So Because I don't know Visual Basic at all can you tell me which lines in this script I would edit to my specifics? I am almost there it I just can't bridge the final gap.


    Set ctl = Me.lstEmployees
    For Each varItem In ctl.ItemsSelected
    rs.AddNew
    rs!EmpID = ctl.ItemData(varItem)
    rs!OtherValue = Me.txtOtherValue
    rs.Update
    Next varItem

  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

    Set ctl = Me.lstEmployees
    For Each varItem In ctl.ItemsSelected
    rs.AddNew
    rs!EmpID = ctl.ItemData(varItem)
    rs!OtherValue = Me.txtOtherValue
    rs.Update
    Next varItem
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    taliorn is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2016
    Posts
    11
    Thank You.... so close... I almost have this. I need to play with that a little but I think I can figure it out now.

    Thanks again.

  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
    No problem, post back if you get stuck. The sample db should 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: 3
    Last Post: 04-29-2015, 04:02 PM
  2. Replies: 1
    Last Post: 05-20-2013, 01:45 PM
  3. Replies: 2
    Last Post: 12-29-2012, 03:11 PM
  4. Replies: 3
    Last Post: 11-16-2011, 11:53 AM
  5. Replies: 3
    Last Post: 06-01-2009, 01:41 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