Results 1 to 3 of 3

Thread: Forms (2003)

  1. #1
    3 Star Lounger
    Join Date
    Nov 2002
    Location
    South Carolina, USA
    Posts
    257
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Forms (2003)

    Ok...here is my problem. I have 3 forms. 1 form allows the user to enter information about a renter. Form 2 - allows the user to enter information about the complex - each room. To attach the renter to the room, I have created a 3rd form. What I would like to do, is on the renter form, enter all demo information and then click on a button to open the 3rd form and for it to automatically display the renter information and then let me select the appropriate complex and room. I can't seem to transfer the renter to the 3rd form...I am having to pick from a drop down.

    Any help would be appreciated!
    Deborah

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Forms (2003)

    I assume that you have a field that uniquely identifies the renter, let's call it RenterID for illustration purposes.
    You can pass the value of RenterID from Form1 to Form3 in the OpenArgs argument of DoCmd.OpenForm:
    <code>
    DoCmd.OpenForm FormName:="Form3", DataMode:=acFormAdd, OpenArgs:=Me.RenterID
    </code>
    You can inspect OpenArgs in the On Load event of Form3:
    <code>
    Private Sub Form_Load()
    If Not IsNull(Me.OpenArgs) Then
    ' Do something with the value of RenterID here, for example
    Me.RenterID = Me.OpenArgs
    End If
    End Sub</code>

  3. #3
    3 Star Lounger
    Join Date
    Nov 2002
    Location
    South Carolina, USA
    Posts
    257
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Forms (2003)

    PERFECT!!!

    Thank you, Hans...as usual...you are great!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •