Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Nov 2001
    Location
    Northwich, Cheshire UK
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Linking Forms (ACCESS 2000)

    Hello,

    I am building a database to hold the responses for a questionnaire, I cannot get all the questions on one form so I have to use more. I would like the forms to show up with the same response ID upon opening.

    The data source for all forms is the data storage table. I can fit about 5 questions on a form that fits on the screen (I don't want to scroll). I open the next form using a button at the bottom of the page. Every form has got a field displaying the response ID.

    If I go from one form to the next the new form shows up with the first record and I would like it to show up with the record I was working on before I moved to that page.

    Is there a way of doing this? Any help, ideas or suggestions are much appreciated.

    Thanks,

  2. #2
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    USA
    Posts
    379
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Linking Forms (ACCESS 2000)

    Attach a module to your button that opens the second form. Use the OpenForm action:

    <pre> Dim stDocName As String
    Dim stLinkCriteria As String


    stDocName = "Your Form Name"
    DoCmd.OpenForm stDocName, , , stLinkCriteria
    </pre>


    To open a form and restrict its records to those specified by the value of a control on another form, use the following expression for the variable stLinkCriteria:

    [fieldname] = Forms![formname]![controlname on other form]

    The fieldname argument is your field ResponseID. The controlname on other form argument is the name of the control on the other form that contains the value you want records in the first form to match.

    This came from OpenForm in Access Help. Check it for further more details.
    HTH

  3. #3
    New Lounger
    Join Date
    Nov 2001
    Location
    Northwich, Cheshire UK
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Linking Forms (ACCESS 2000)

    Thank you Thomas,

    The solution you pointed out works fine, much obliged.

Posting Permissions

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