Results 1 to 2 of 2
  1. #1
    d3adelvis is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    1

    Pre-poulate Subform with a row for each attendee

    Hi



    I have a form called Workshop.

    Main Form: WorkShop. ([WorkShopId] int, [WorkshopName] text, [WorkshopDate] date/time)
    Sub Form: WorkShopAttendees ([WorkShopId] int, [EmployeeId] int, [Attended] yes/no, [ReasonId] int)

    When a new WorkShop record is created, I want to populate the SubForm with:

    AttendeeName
    Attended? (Checkbox)
    Reason (DropDown)

    The checkbox will be ticked unless it is reported that the employee was absent (Annual Leave, Sick etc.)

    The person who hosted the WorkShop will then check that the List is correct before hitting a button.

    The button will insert all the subform data into the WorkShopAttendees table.

    What is the best way of acheiveing this?

    I don't need a full solution, just some pointers. Like how do I grab the WorkshopId if the record has not yet been saved?
    Is it best to use a query or write some code and create a recordset? I even toyed with the idea of putting the results in a tmp table then doing the insert from there but couldn't grab the WorkShopId!

    I can write SQL till the cows come home but my VBA skills are not the best.

    Has anybody don a similar thing before? i have searched everywhere! Maybe my search terms are not the best.

    Thanks in advance!

  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,652
    Presuming you have a table of attendees, you can execute an append query that gets the attendees from there and the ID number from the form. You may need to force a save of the record:

    If Me.Dirty Then Me.Dirty = False
    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. Drop down for both attendee and department
    By cougardoogan in forum Forms
    Replies: 4
    Last Post: 07-03-2012, 01:45 PM
  2. Replies: 6
    Last Post: 05-05-2012, 08:43 AM
  3. Replies: 3
    Last Post: 04-17-2012, 10:28 AM
  4. Replies: 4
    Last Post: 03-30-2012, 01:47 AM
  5. Replies: 1
    Last Post: 11-29-2011, 01:37 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