Most Recent Entry Only (1 Viewer)

Lily

Registered User.
Local time
Today, 15:49
Joined
Oct 1, 2000
Messages
42
Hello,

I need to generate a report based on a form and sub-form. The main form lists company name, etc., and the sub-form lists specific contact information consecutively. Is there a way to have the report show only the last entry made on the sub-form for each company? Thanks very much for any advice or suggestions.

Lily
 

llkhoutx

Registered User.
Local time
Today, 09:49
Joined
Feb 26, 2001
Messages
4,018
Build your recordsource with a query selecting the "Last" record via appropriate criteria.
 

Lily

Registered User.
Local time
Today, 15:49
Joined
Oct 1, 2000
Messages
42
llkhoutx,

Thanks for your help. I was able to generate a query to give me the company name and the last "details" entered, however, the query results are not always correct. If you may have any suggestions? The sub-form lists date, total hours, comments. When I run the query it does give me the company, latest date, total hours (all these fields appear to be correct). However, the last field, comments, is not always putting the "last" comment in the query, but rather picking up a comment from sometimes the row above (from the record in the sub-form), sometimes two or three rows above, yet the date and hours are correct. So I am stumped if you may have any advice. Thank you very much for your help.

Lily
 

Alexandre

Registered User.
Local time
Today, 21:49
Joined
Feb 22, 2001
Messages
794
Lily,

On what field do you sort to obtain the "last" record? I would say that you should first work at the level of data entry to automatically register Date() or Nom() in your table when a record is added-modified (using the after change event) after having added at DateLastModified field in your table.
Then you would select your record by building a query on two criterias: the last DateLastModified AND of course the given companyID(s)). An build your
SubReport source on this Query as llkhoutx
said.

Hope this helps
JL
 

Lily

Registered User.
Local time
Today, 15:49
Joined
Oct 1, 2000
Messages
42
Just a note of thanks to you both! I did get it to work and appreciate your help very much. Alexandre...that is an idea I had not thought of, so I will try that, and thank you for your advice.

Lily
 

Users who are viewing this thread

Top Bottom