Results 1 to 3 of 3
  1. #1
    Join Date
    May 2003
    Posts
    14

    Unanswered: Open Form Based On Multiple Fields

    I have a talent table that list the TV comercials by individual (SSN and name) and are displayed in a Commercial List form. On that form, I want to add a button to open another form which will display all of the payments (payment table) made to that individual. The button options let you open a form to a specific record based on matching a single field between the two tables. I need to open the form based on matching multiple fields. In otherwords, I want to click on the the detail commercial record, displayed by The Commercial List form, and then click on the button for the Payment List form and have it show all of the payments made to that individual for that commercial sponsor (needs to match on SSN and sponsor). Both fields are displayed in both forms. I hope this makes sense. I appreciate any help given.

    Thanks

  2. #2
    Join Date
    Jun 2003
    Location
    Belgium
    Posts
    133

    Re: Open Form Based On Multiple Fields

    Hi calprof,

    you could try the following :
    let's assume that the objects on the first form are called "txtSSN" and "txtSponsor".

    Write this codeline in the OnClick-event for the button :
    DoCmd.OpenForm "frmFormName", , , "[SSN]='" & Me!txtSSN & "' AND [Sponsor]='" & Me!txtSponsor & "'"

    This should do the trick.
    When writing the code, take good care of the textmarkers ' and "

  3. #3
    Join Date
    May 2003
    Posts
    14

    Re: Open Form Based On Multiple Fields

    Herman,
    That worked perfectly. THANKS!!!!

    Calprof

Posting Permissions

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