• Query Criteria from Form (Access 2000)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Query Criteria from Form (Access 2000)

    Author
    Topic
    #394737

    I am trying to create a query which takes the criteria from a textbox in a form, which itself has been filtered.

    I have a button on the form with runs the query, which should display all dates for ther person shown in the textbox on the form.

    I have tried useing:
    =[textbox]

    and:
    [form]!formname]![textbox]

    and:

    [me]![textbox]

    where formname is the name of the form and textbox is the name of the textbox.

    but it when I run the query it just comes up asking what i want [form]!formname]![textbox] contains.

    How do you get it so that the query will use the textbox on the form as the criteria?

    Viewing 1 reply thread
    Author
    Replies
    • #726018

      You almost got it right. The correct expression is

      [forms]![formname]![textbox]

      In other words, use Forms instead of Form, and there was a missing left bracket before formname.

      Added: Thanks to SteveH for pointing out the missing bracket! I overlooked that one.

      • #726024

        you are also missing a left-hand square bracket

        [forms]![formname]![textbox]

        • #726028

          Oops, thanks for pointing that out. The devil is always in the details.

        • #726029

          Oops, thanks for pointing that out. The devil is always in the details.

      • #726025

        you are also missing a left-hand square bracket

        [forms]![formname]![textbox]

    • #726019

      You almost got it right. The correct expression is

      [forms]![formname]![textbox]

      In other words, use Forms instead of Form, and there was a missing left bracket before formname.

      Added: Thanks to SteveH for pointing out the missing bracket! I overlooked that one.

    Viewing 1 reply thread
    Reply To: Query Criteria from Form (Access 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: