• Code behind form (2002/sp3)

    Author
    Topic
    #449391

    I am trying to write the code to open a report and set the query behind it with values in two fields. I can do it with one value but I’m not sure how to code the second field and value.

    My Attempt: DoCmd.OpenReport “rptReportStudentsSortedByGradYear”, acViewPreview, , “[none]=0 and [gradyear]= me.txtGradYear”

    The part from and on is what I am not doing correctly I am trying to take a value in a textbox on the form and place it in the [gradyear] field of the query along with a 0 in the [none] field.

    Thanks for the help.

    Paul

    Viewing 0 reply threads
    Author
    Replies
    • #1101681

      Try

      ..., "[none]=0 and [gradyear]= " & Me.txtGradYear

      This assumes that gradyear is a number field.

    Viewing 0 reply threads
    Reply To: Code behind form (2002/sp3)

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

    Your information: