Results 1 to 3 of 3
  1. #1
    kegoosse is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Jun 2017
    Posts
    6

    Fill in Form fields based on combo box from another form

    Hello,

    My situation is the following:

    I have 2 forms (Form A and B). Form A contains a combo box, and a command button that opens form B.

    Question:

    What VBA code should I use for the command button in order to fill 1 field from form B with the selection from the combo box in form A?


    I know what to do when I remain within 1 form, but it's the first time I'm trying this with 2 forms. Probably very simple, but I can't find the solution.

    Thanks in advance for any help
    Kenneth

  2. #2
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,511
    Few ways to do that. In the OnOpen Event of Form2, add:

    Me.Field1 = Forms!Form1!Combobox1

    Field1 is the field on Form2. Change the names of the forms and fields to your actual names.

  3. #3
    kegoosse is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Jun 2017
    Posts
    6
    Thanks. Was not familiar with the OnOpen Event.

    Problem solved!

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

Similar Threads

  1. Replies: 4
    Last Post: 10-13-2014, 09:20 AM
  2. Replies: 4
    Last Post: 04-18-2014, 06:14 AM
  3. Replies: 3
    Last Post: 03-21-2012, 01:43 PM
  4. Replies: 5
    Last Post: 09-14-2011, 03:41 PM
  5. Replies: 1
    Last Post: 02-25-2011, 10:03 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