Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    New form using ID# from original form (Access XP)

    I want to click on a button to open a new form. When the new form open I want it to have the same MembershipID on the new form as the original form. What must I do to make that happen.

    Thanks
    Fay

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

    Re: New form using ID# from original form (Access XP)

    If you want to display an existing record in the new form, pass a Where-condition in the OpenForm method. The OnClick event handler for a command button named cmdOpen top open a form named frmTest should look like

    Private Sub cmdOpen_Click()
    DoCmd.OpenForm "frmTest", , , "MembershipID = " & [MembershipID]
    End Sub

    This assumes that MembershipID is numeric. If it is a text field, enclose it in quotes. Use Chr(34) to include quotes in a string:

    ..., "MembershipID = " & Chr(34) & [MembershipID] & Chr(34)

  3. #3
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: New form using ID# from original form (Access XP)

    Hans, thanks I finally got it to work. Thanks for the help.

    Fay

Posting Permissions

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