• Report using a form (Access 97)

    Author
    Topic
    #432810

    Here is my process. I click on a form that allows me select a class to register a student. I enter the student’s name and then I want to print a receipt. On the receipt, I want it to transfer the class information (which appears in subform) and the student information. All I need to do next is to print the receipt.
    It is raining cats and dogs in SC and I believe it has impaired my thinking. It should not be hard to do this….I just can’t seem to get it to click today.

    Thanks!
    Deb

    Viewing 0 reply threads
    Author
    Replies
    • #1016181

      Is the receipt a report in Access? If so then open the report filtered to the student and class ID.
      docmd.openreport “reportname”,,,”studentid= ” & me.studentid & “and classid =” & me.classid.
      If the issue is referring to the subform, post back please

      • #1016191

        Yes, there is a subform involved.

        • #1016193

          See attached Doc. It has all the variations for referring to main and sub and sub-sub forms. It is by Keri HArdwick and referred to all the time. Worth downloading and keeping. It has saved me much hassle many times.

          • #1016196

            Thanks, I will save the information.

            Let me ask you this. Do I put the commands in the vba or in the qry for the report?

            • #1016198

              you can do either. One method is to put the where clause in the openreport in VBA, the other is to build the query that the report is based on, so that the criteria for student and class refer to the controls on the form. If you do the second, just put in the onopen of the report code to make sure the form with the criteria is open, otherwise the enduser will be confronted with parameter boxes that they do not understand.
              Hope this helps.

            • #1016200

              One more question.

              I have put the me! clause in the qry for the report. I know i am doing something wrong because I get prompt with parameter box. When I enter the parameters, it works great. See if you can help me here.

              Main form = frmcalendar enrollment sub 2
              subform 1 = frmcalendar course code
              subform 2 = frmcalendar nonstudent form

              the fields are dateoffered, coursecat, studentid.

              Under the dateoffered in the query, how would I enter this in to accept the date off of the screen. the date is in the frmcalendar course sub form.

            • #1016202

              you cannot use the me syntax, you have to use the whole Forms!… syntax.
              But you can save time by using the build button when you rightclick in the criteria box in the QBE grid.

            • #1016205

              Thanks!

              I have worked with access for a long time and never noticed the build in the qbe. I have always typed it in. I got it working!

            • #1016206

              great!

    Viewing 0 reply threads
    Reply To: Report using a form (Access 97)

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

    Your information: