Results 1 to 2 of 2
  1. #1
    nsteff is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2017
    Location
    Pennsylvania
    Posts
    3

    Post Create a macro that will automatically create 3 records, each with a different site in <Site> field

    My goal is to create a macro that will automatically create 3 records, populating each with a different site in the <Site> field.



    I have created a data entry form with a data entry Subform. When data is added to the form, <Form ID> is automatically updated in both the form and the Subform. <Form ID> is the relational field and is the key for the Form table. For each record in the Form table, there can be many records in the Subform table. I would like to create a macro that once the <Form ID> is updated in the Subform:
    • Subform Record 1 is completed by + field <Subform ID> being automatically updated + field <Site> is populated with XX.
    • Create Subform Record 2 with same <Form ID> + field <Subform ID> being automatically updated + field <Site> is populated with YY.
    • Create Subform Record 3 with same <Form ID> + field <Subform ID> being automatically updated + field <Site> is populated with ZZ.


    Notes:
    XX, YY, and ZZ are consistent known values.
    By adding the records for each site, it will trigger each site to complete populating data in the Subform.

    I haven't created a database in over 10 years, so I am sorta like a newbie, in some respects. Your help will be truly appreciated, as I have mulled over this for 2 days. Thanks!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    21,431
    Simplest would be to execute an append query. That query could get the ID from the main form, and presumably the site values from a site table. Your macro or VBA code would execute that query then requery the subform so it displayed the records.
    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. Problems with the site??
    By orange in forum General Chat
    Replies: 6
    Last Post: 08-05-2016, 06:59 AM
  2. Can you display your ERD on this site?
    By jpanther36 in forum Access
    Replies: 1
    Last Post: 08-02-2016, 03:27 AM
  3. Web Site Display
    By number6car in forum Access
    Replies: 2
    Last Post: 01-12-2015, 02:24 PM
  4. Replies: 30
    Last Post: 01-16-2012, 05:49 PM

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 - Senior Forums