Results 1 to 6 of 6
  1. #1
    ProgZ is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2011
    Posts
    4

    Passing Information from a report to a form

    New to the forum but relatively competent in both Access and VBA. I suspect this may ultimately become a VBA question but thought I would start in the Forms section and go from there.

    I am going to post a brief overview of what I have been tasked with in hopes of someone pointing me in the right direction if more information is needed I will certainly post more.

    A company has a built a report that contains customer information such as First and Last Name Address things like that. These items are stored in the Cust.Info Table

    This report is used for various things. The company has asked for me to place an Edit button on the report to allow people to submit edit requests. When they click the edit button it should launch a form pre-filled with that records information (the record they were viewing), allow the user to make their suggested changes and submit the information to be stored in a separate table Edit_Requests for viewing on a different report.

    This posed some unique issues I've never addressed before and am hoping this forum can help me out.

    First issue. I need to pass the unique "customer key" and record information from the report to populate the edit request form upon a button click.

    Second when I edit that information and save, I need it to save to a different table than the table it was pulled from.

    View record on report > Edit record in pre-filled form> save record to new/different table

    Any direction you can provide will be much appreciated.



    Thank you.

  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,092
    See if this works for you:

    http://www.baldyweb.com/wherecondition.htm

    Can the form can be based on the other table?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    ProgZ is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2011
    Posts
    4
    Wow, quick and easy. This worked perfectly for pre-filling my form.

    Now any advice on saving the changes i make to this form to a different table?

    Thanks.

  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,092
    If the form can't be based on the other table, then you're looking at either opening a recordset on it or executing SQL (update or append, as appropriate).
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    ProgZ is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2011
    Posts
    4
    Quote Originally Posted by pbaldy View Post
    If the form can't be based on the other table, then you're looking at either opening a recordset on it or executing SQL (update or append, as appropriate).

    I was playing with executing an SQL append.

    For ease of explanation I'm going to strip down the form to just First Name, Last Name, and CustomerNum (AutoNum)

    Original Table: Customer_List (Fname, LName, CustNum)
    Table to save edit requests to: Cust_Edit_Request (identical structure)

    Form Name: F-Cust_Edit (populated by [Customer_List] Table)
    Form fields: Fname, Lname, CustNum

    Can someone provide me a sample VBA SQL statement that will write the information from the form F-Cust_Edit to the Cust_Edit_Request table.

    I hope to take this sample code and fill in the rest of the fields on the form.

    Much thanks appreciated in advance!

  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,092
    Lost track of this thread. Did you get it sorted out?
    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: 1
    Last Post: 03-24-2011, 07:09 AM
  2. Replies: 3
    Last Post: 02-22-2011, 01:28 PM
  3. Passing param. to Report
    By kaledev in forum Programming
    Replies: 5
    Last Post: 01-20-2011, 12:46 PM
  4. Replies: 2
    Last Post: 08-20-2010, 04:50 AM
  5. Passing parameters to a report
    By elmousa68 in forum Access
    Replies: 0
    Last Post: 12-07-2006, 01:38 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