Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

My database holds user permissions.

Status
Not open for further replies.

hibbie0762

IS-IT--Management
Joined
Dec 21, 2000
Messages
6
Location
GB
My database holds user permissions. Table 1 contains User details and Table 2 contains User periods of approval. The tables are linked on a unique UserID. Each record in table 1 is unique but there may be several related records (events) in table 2. There are pop up forms based on each table. The related Form 2 records are accessed by means of a button on Form 1.

Where more than one related record exists in Form 2, I want to be able to limit display to only the most recent record, based on a date field. So far I have totally failed to crack this one, but I know that there must be a way of doing it. Any guidance would be welcome.
 
One way is to utilize the MAX function as a part of the form's RecordSource. This function can be applied to dates. In conjunction with your WHERE condition and perhaps a JOIN, you can pull the record you are looking for.

Another way is to change the ORDER BY in your Recordsource to show the record with the most advanced date first.

Gary
gwinn7
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top