Printing a report

P

Peggy

I am new at this so please be patient. Also, if you answer
you must be pretty specific or I won't understand.

I have a subform on a form. It is basically an accounting
of the person on the form. Some fields include, date, type
of service, past due, current due, balance etc. Can I
print a report that gives only the most current data on
this subform. This would be the last record?
 
J

John Vinson

I am new at this so please be patient. Also, if you answer
you must be pretty specific or I won't understand.

I have a subform on a form. It is basically an accounting
of the person on the form. Some fields include, date, type
of service, past due, current due, balance etc. Can I
print a report that gives only the most current data on
this subform. This would be the last record?

A Form doesn't contain any data. It's a tool, a window to get data
into a Table; your Report should be based on a Query referencing that
table. This Query can (if you wish) use a control on the form as a
criterion for this query, but not knowing just what you want reported
it's hard to be very specific.

Note that you will need to explicitly save the data on the form into
the table before opening the report - this can be done easily with a
line of VBA code (in the Click event of the button that launches the
report):

DoCmd.RunCommand acCmdSaveRecord
 
G

Guest

-----Original Message-----


A Form doesn't contain any data. It's a tool, a window to get data
into a Table; your Report should be based on a Query referencing that
table. This Query can (if you wish) use a control on the form as a
criterion for this query, but not knowing just what you want reported
it's hard to be very specific.

Note that you will need to explicitly save the data on the form into
the table before opening the report - this can be done easily with a
line of VBA code (in the Click event of the button that launches the
report):

DoCmd.RunCommand acCmdSaveRecord


.
This is one of the problems with being a newbie. We don't
know how to phrase our questions.
Yes, I understand that the data goes to a table.
I just want to create a report for each customer that
shows only their current balance.
 
J

John Vinson

Yes, I understand that the data goes to a table.
I just want to create a report for each customer that
shows only their current balance.

How (looking at data in the table) can you ascertain the current
balance? By date, by summing transactions over all historical
transactions, or what?

This can be done using a Query - but without a better understanding of
your table structure I can't tell you just what query!
 
P

Peggy

I guess field that would tell me the current information I
would want on the report would be the most current date.
The fields in my table are.

PaymentID
CustomerID
date
service (either "General Pest" or "Collection")
PastDue
CurrentDue
Balance

I have thought about fields that are "Month" and "Year"
for the query. With this I might sometimes get two reports
for a customer since they could make a payment and recieve
service in the month. The months are the service tickets
that are printed out when service is rendered.
 
J

John Vinson

I guess field that would tell me the current information I
would want on the report would be the most current date.
The fields in my table are.

PaymentID
CustomerID
date
service (either "General Pest" or "Collection")
PastDue
CurrentDue
Balance

A criterion on [date] of

=(SELECT Max([date]) FROM yourtable AS X
WHERE X.CustomerID = yourtable.CustomerID)

would find the most recent payment for a customer.
I have thought about fields that are "Month" and "Year"
for the query. With this I might sometimes get two reports
for a customer since they could make a payment and recieve
service in the month. The months are the service tickets
that are printed out when service is rendered.

Now that I don't understand at all. You can put two calculated fields
in the query defined as

PaymentMonth: Month([date])
PaymentYear: Year([date])

but I don't see how they'd be useful in this context; if you just want
to find all transactions in a particular month, instead you can use a
criterion of

BETWEEN DateSerial([Enter year:], [Enter month:], 1) AND
DateSerial([Enter year:], [Enter month:] + 1, 0)
 
G

Guest

Thank you for your help. I am visiting relatives right now
and will try this when I get home where it is quiet.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top