Results 1 to 4 of 4
  1. #1
    Galhered is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2020
    Posts
    2

    Passing information from one form to another.

    Hi. I have a form in continuous forms view and a button that allows the user to select a record from the returned list. The idea is I want to open the new form but at a new record with some of the data from the selected case transferred to the new form. I have tried to do this but without success.
    This code:
    Private Sub btnSelectAudit_Click()


    DoCmd.OpenQuery "qrySelectedAuditCase"
    DoCmd.OpenForm "FrmAudit", , acNewRec


    Forms!frmaudit.Underwriter = Query!qryselectedauditcase.LC_AuthByName
    DoCmd.OpenForm "FrmAudit", , , "Underwriter = '" & Me.LC_AuthByName & "'"

    End Sub
    I tried to put a stage between to have only one record (hence the open query step). The last DoCmd I include because it was my first attempt. There are 4 values in the open form that I would like to pass into the new form as pre-populated values.
    Any help appreciated!

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922

  3. #3
    Galhered is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2020
    Posts
    2
    Thank you - that seems fine for one field, but how do I do this for more than one field?

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Got that covered too: http://www.baldyweb.com/OpenArgs.htm

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

Similar Threads

  1. Passing information from one form to another
    By S2000magician in forum Programming
    Replies: 8
    Last Post: 08-17-2019, 01:23 PM
  2. Replies: 17
    Last Post: 02-25-2018, 02:37 AM
  3. Replies: 12
    Last Post: 04-14-2017, 03:17 PM
  4. Replies: 3
    Last Post: 05-02-2014, 09:27 AM
  5. Replies: 5
    Last Post: 04-03-2011, 10:24 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