Report only last record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to set up a querry that sorts the records by two fields, GRADE
and LOT #. But I only want the record corrisponding to the last LOT #
reported for each GRADE.

Any ideas?
 
Are we to understand which is the "last" LOT #. Is this the maximum value of
a field?
 
The LOT field contains an alphanumeric code. I would like to sort this
field. The last lot is the last one in the sort order.

Does that make sense.
 
I would sort by GRADE Ascending with a group header and then by LOT #
descending. Add a text box to the detail section:

Name: txtLotCount
Control Source: =1
Running Sum: Over Group

Then add code to the On Format event (in the code window) like:

Cancel = Me.txtLotCount > 1
 
I tried it. No joy.

I had to modify it a bit to get a report going, did I mess things up? It
just gives me a list of hte grades with no lots shown. I tried increasing
the 1 to a 2, but I still just got a list of grades.

What I did was:

In details section
Name: txtLotCount
Control Source: = LOT (LOT is also shown in details section)
Running Sum: Over Group

Then add code to the On Format event (in the code window) like:

Cancel = Me.txtLotCount > 1 IN On Format event of detail.
 
Because when I put in 1 it gives me a pop up box when I run the report. Wait
you meant "=1" Stupid stupid me. Wait let me try it.....

Well it gives me only one lot for the first grade, but not the last or first
lot???? and no lots for the other 6 grades. HMMM.

Thanks for trying.
 
Went back and started over. Now it works great. Not sure what I did wrong
the first time.

Thanks again.
 

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

Back
Top