Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2018
    Posts
    1

    Form that creates multiple records...

    Struggling to find a starting point with this task I've set myself.

    I'm importing data from SalesForce, and I'm trying to build a form that would auto-populate one of those fields

    Field from SalesForce (example, task01)
    Start Year (example, 2015)
    End Year (example, 2020)


    Value (example, 321,000)

    And submitting the form creates a number of records in a table, in this example...

    task01, 2015, 321,000
    task01, 2016, 321,000
    task01, 2017, 321,000
    task01, 2018, 321,000
    task01, 2019, 321,000
    task01, 2020, 321,000



    Any pointers on how to get started with it would be amazing.

  2. #2
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Run a procedure looping through the years one at a time and in each case running an append query
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Something like:

    For x = Me.tbxStart To Me.tbxEnd
    CurrentDb.Execute "INSERT INTO table(Task, TaskYear, Amount) VALUES('" & Me.tbxTask & "', " & x & ", " & Me.tbxAmt & ")"
    Next

    Value is a reserved word. Should not use reserved words as names for anything.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 3
    Last Post: 03-17-2017, 08:00 AM
  2. Replies: 10
    Last Post: 09-20-2016, 03:25 PM
  3. Replies: 5
    Last Post: 09-29-2015, 11:08 AM
  4. Replies: 6
    Last Post: 01-12-2012, 09:13 AM
  5. Form that creates records from a template
    By techaddiction7 in forum Forms
    Replies: 6
    Last Post: 07-20-2011, 05:11 AM

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