Results 1 to 10 of 10
  1. #1
    3 Star Lounger
    Join Date
    Nov 2002
    Location
    South Carolina, USA
    Posts
    257
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Report using a form (Access 97)

    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

  2. #2
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Jerusalem, Israel
    Posts
    708
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Report using a form (Access 97)

    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

  3. #3
    3 Star Lounger
    Join Date
    Nov 2002
    Location
    South Carolina, USA
    Posts
    257
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Report using a form (Access 97)

    Yes, there is a subform involved.

  4. #4
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Jerusalem, Israel
    Posts
    708
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Report using a form (Access 97)

    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.

  5. #5
    3 Star Lounger
    Join Date
    Nov 2002
    Location
    South Carolina, USA
    Posts
    257
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Report using a form (Access 97)

    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?

  6. #6
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Jerusalem, Israel
    Posts
    708
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Report using a form (Access 97)

    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.

  7. #7
    3 Star Lounger
    Join Date
    Nov 2002
    Location
    South Carolina, USA
    Posts
    257
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Report using a form (Access 97)

    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.

  8. #8
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Jerusalem, Israel
    Posts
    708
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Report using a form (Access 97)

    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.

  9. #9
    3 Star Lounger
    Join Date
    Nov 2002
    Location
    South Carolina, USA
    Posts
    257
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Report using a form (Access 97)

    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!

  10. #10
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Jerusalem, Israel
    Posts
    708
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Report using a form (Access 97)

    great!

Posting Permissions

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