Results 1 to 3 of 3
  1. #1
    bomich is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Oct 2012
    Posts
    10

    Storing a value from a form to auto populate a field in another form

    I have made a form (form 1) that searches for and displays a record from table 1 (which holds information on a process and a hyperlink to work instructions etc..)



    I then have a button on form 1 which opens a data entry form (form 2) to record that the process has been carried out in table 2 (with fields like process ref, operator name, date etc..)

    I want to be able to store the value of the process ref field (the primary key in table/form 1) and automatically enter this value into form 2 when it is opened using the button.

    I think it needs some code to store a value or string on the 'on click' event of the button (form 1) and then a line in the 'on open' of form 2 to make form 2 process ref equal to the stored value...

    I'm a real vba noob so I don't really know where to start.

    Somebody help please!!?

  2. #2
    bomich is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Oct 2012
    Posts
    10
    I have tried this:

    Private Sub button_Click()


    DoCmd.OpenForm "Form 2", , , , acAdd, acDialog
    Forms![Form 1]![Process ref] = Me.Process_Ref



    End Sub


    It doesn't work but I believe it should..?!

  3. #3
    bomich is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Oct 2012
    Posts
    10
    Solved it!!

    Me.Process_Ref = Forms![Form 1]![Process ref]

    Was correct but it needed to go in the on load event of form 2...!

    Thanks For all your help..

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

Similar Threads

  1. Replies: 63
    Last Post: 01-25-2013, 05:20 AM
  2. Replies: 3
    Last Post: 10-03-2011, 02:33 PM
  3. Auto Populate form
    By fpsmi in forum Access
    Replies: 1
    Last Post: 09-16-2011, 09:24 AM
  4. Auto populate a field (without a form)
    By DonL in forum Access
    Replies: 1
    Last Post: 06-21-2011, 03:19 AM
  5. Replies: 3
    Last Post: 10-05-2009, 07:22 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