Results 1 to 4 of 4
  1. #1
    Tewbrainer is offline Novice
    Windows Vista Access 2007
    Join Date
    Oct 2011
    Posts
    2

    Carry data from one form to another.

    Hello everyone! I am normally pretty good at figuring stuff out with Google-fu, but this question has completely stumped me. I am building an access db for work and need it to do this:

    User enters their name into a combo box (MainUser) on one form (HomePage). Then they press a button that opens a new form (NewEvent). On NewEvent, there is a combobox (User) that I would like to automatically populate based on HomePage!MainUser.



    I have tried everything I can think of (default value, before update, form load...) and I know this is probably something that is painfully easy to figure out.

    I appreciate any help you can give!

  2. #2
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    In the button's click event which opens the form, use the OpenArgs argument:

    Code:
    DoCmd.OpenForm "NewEvent", acNormal, , DataMode:=acFormAdd, OpenArgs:=Me!MainUser
    Then in the LOAD event of the NewEvent form, use:
    Code:
    If Len(Me.OpenArgs & vbNullString) > 0 Then
        Me.YourUserControlNameHere = Me.OpenArgs
    End If

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    See if one of Paul's solutions at the top of this link offer a hint for you: http://www.baldyweb.com/

  4. #4
    Tewbrainer is offline Novice
    Windows Vista Access 2007
    Join Date
    Oct 2011
    Posts
    2
    Couldn't have worked better, you rock Bob!

    How did I not think to OpenArgs the open button? *Smacks forehead*

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

Similar Threads

  1. Carry value over to new record w/macro
    By bbrazeau in forum Programming
    Replies: 5
    Last Post: 10-27-2011, 09:00 AM
  2. Replies: 0
    Last Post: 03-23-2011, 11:29 PM
  3. Replies: 26
    Last Post: 01-09-2011, 05:30 PM
  4. Replies: 0
    Last Post: 01-03-2011, 03:38 PM
  5. Replies: 1
    Last Post: 01-22-2008, 03:36 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