Results 1 to 4 of 4
  1. #1
    arothacker is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2014
    Posts
    43

    Form pulls info into fields based on ID number

    I have a form called "Headcount" that displays employee information. It has a drop down field called "Selection". When the user picks a value from the drop down a form called "New" pops up for them to fill in a new line of information.

    Is there a way for the "New" form to pull in information from the record that the drop down was selected for? This information will then be submitted as a new record.

    For example, there is a record with the following information:
    ID:1234
    Location:Miami
    Type:Salary



    The employee is leaving so the user will select "Leaving" from the drop down and the "New" form pops up and automatically pulls in the ID, Location, and Type. I've played around with DLookups but haven't been too successful.

    Thanks!!

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    In the after update on the drop down,
    you would open the "NEW Form" with openargs based on the drop down.

    See this for more detail

  3. #3
    arothacker is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2014
    Posts
    43
    Thanks for this...I'm a little confused as how to write the openargs. Both forms have the fields ID, Location, and Type. The user will click the drop down value and the "New" form will pop up. I want the data from the record selected to copy over to the "New" form. Do you have to do something with the primary key?

    My code is so far is:
    If Selection.Value = "OPEN" Then
    DoCmd.OpenForm "New", acNormal,,,acFormAdd,,

    Then I get stuck as how to reference the openargs...what would be an example if for the record selected on the "Headcount" form, copy over the value for "Location" into the "New" form

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    See this tip from FMC.

    You can also google to find other examples.

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

Similar Threads

  1. Replies: 2
    Last Post: 02-20-2014, 05:54 PM
  2. Replies: 7
    Last Post: 12-02-2012, 08:32 PM
  3. Replies: 4
    Last Post: 11-20-2011, 01:08 PM
  4. Replies: 5
    Last Post: 09-14-2011, 03:41 PM
  5. Form pulls info from 2 tables.
    By Jonpro03 in forum Forms
    Replies: 6
    Last Post: 07-20-2011, 11:33 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