General discussion

Locked

Access 97 Print 1 Report

By MRA2 ·
My Access 97 Database is almost complete BUT lacking 1 item. When I am viewing a member's payment records, I would like to print out only the current years record on a receipt like form for the CURRENT MEMBER ONLY!
Each member has several year's payments showing in a sub form ( ie: 2000 2001 2002)

So for the current member I want to print the current member's payment for 2002 ONLY!!

Thanks for any help you can offer...

Alan

This conversation is currently closed to new comments.

8 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Access 97 Print 1 Report

by mslizny In reply to Access 97 Print 1 Report

to get the results you want, you need to select out the records for just the specified year. I would suggest making a query that selects only the records in a specified year (it can be a parameter query if you want to choose the year at the time ofprinting the receipt form.

You can make a button on the main form that opens the receipt form with the query selecting the current year as its source. The receipt form will then show only the records for the selected year.

Collapse -

Access 97 Print 1 Report

by MRA2 In reply to Access 97 Print 1 Report
Collapse -

Access 97 Print 1 Report

by sl-campbell In reply to Access 97 Print 1 Report

If you are opening a report from the form via command button then you pass the filter:

Assuming you already have a report created based on the same record selection as the form:

DoCmd.OpenReport stDocName, acPreview, , "MemberNum='" & Me.MemberNum & "'"

Where stDocName is the name of the report and MemberNum is the name of the field that holds the Members unique ID.

Collapse -

Access 97 Print 1 Report

by sl-campbell In reply to Access 97 Print 1 Report

As I said, I assume you have a report already made that shows all the records. So you only need to filter it to the one record you are currently on in the form:
DoCmd.OpenReport stDocName, acPreview, , "MemberNum='" &
Me![Combo155].Text & "'"or

DoCmd.OpenReport stDocName, acPreview, , "MemberNum='" & Me.MemberNum & "'"

From your e-mail, I do not understand what you are in need of or where the problem is.

Collapse -

Access 97 Print 1 Report

by MRA2 In reply to Access 97 Print 1 Report

Thanks for your Emails & Help! I got it working well!!!!!!!

Collapse -

Access 97 Print 1 Report

by Bob Sellman In reply to Access 97 Print 1 Report

Create your "receipt" report.

On your payment form (which is where I assume you want to print from), you could include code with an OnClick property as part of, for example, the place where the member's number is listed. (I'm assuming you display multiple members on the form, otherwise you could just put a print button on your form.)

When the user clicks on the member number control (I'll call it txtMember), do something like this:

' get member number (assumes it is a number)

Dim lngMemNbr as Long
lngMemNbr = me.txtMember

' get current year (could also get from form to print any year's receipt...just associate this code with the year display on the form instead of the member number)
' assumes payment year is stored in a field called PayYear

Dim lngYear as Long
lngYear = Year(Date)
DoCmd.OpenReport "rptReceipt",acViewPreview,,"[MemNbr} = " & lngMemNbr & " And [PayYear] = " & lngYear)


' note that if the member number is a string (text), you must surround thevariable containing the member number with single quotes ['], just as date values must be surrounded with # signs

Collapse -

Access 97 Print 1 Report

by MRA2 In reply to Access 97 Print 1 Report
Collapse -

Access 97 Print 1 Report

by MRA2 In reply to Access 97 Print 1 Report

This question was closed by the author

Back to Software Forum
8 total posts (Page 1 of 1)  

Related Discussions

Related Forums