Create String of Forms - Passing Identifier from Form to Form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pcandpetunia
    New Member
    • Feb 2008
    • 1

    Create String of Forms - Passing Identifier from Form to Form

    I am trying to create an Access "applicatio n" that will let users step through the process of creating data. In form 1, the user selects the type of issue that they are entering. In form 2, the user fills in information about the issue. In form 3, the user identifies what locations are affected by the issue. I know that I could make form 2 a subform to form 1, but my users really prefer a more "wizard-like" application.

    The problem that I am having is that when I create a new record on form 1, how do I pass the identifier field to form 2? I can't find information on how to do this when the data record doesn't get created until the user clicks on the "next" button on form 1.

    TIA!
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    Originally posted by pcandpetunia
    I am trying to create an Access "applicatio n" that will let users step through the process of creating data. In form 1, the user selects the type of issue that they are entering. In form 2, the user fills in information about the issue. In form 3, the user identifies what locations are affected by the issue. I know that I could make form 2 a subform to form 1, but my users really prefer a more "wizard-like" application.

    The problem that I am having is that when I create a new record on form 1, how do I pass the identifier field to form 2? I can't find information on how to do this when the data record doesn't get created until the user clicks on the "next" button on form 1.

    TIA!
    There are several Methods of passing Values between Forms, the one I particularly like is to use the last Argument of the OpenForm() Method which is called openargs. To pass the value of the Primary Key Field ([PrimaryKey]) on Form1 to Form2, you can use code similar to the following:
    [CODE=vb]
    DoCmd.OpenForm "Form2", acNormal, , , acFormEdit, acWindowNormal, Me![PrimaryKey][/CODE]

    While in the context of Form2, you reference this passed value from Form1 by using the Statement:
    [CODE=vb]Me.OpenArgs[/CODE]

    Comment

    Working...