DLookup and DMax (1 Viewer)

BEPGroup

New member
Local time
Today, 04:50
Joined
Apr 18, 2013
Messages
5
Hi Forum.

I'm trying to display information on a continuous form in an unbound text box. The form shows one record for each 'client' with a unique ID. There are multiple records (all with a date entry) for contacts with that client, all linked to the ClientID. The formula I've built is currently returning the latest record from the contacts table for all client records on the form. This is what I have so far:

=DLookUp("ELOComment_Details","tbl_ELOComments",DLast("ELOComment_Date","tbl_ELOComments","[tbl_ELOComments]![ClientID]=[Cl_Key]"))

I know I'm not far off, but any suggestions would be gratefully received.

I'm still at the dangerous level when it comes to Access - I don't really know what I'm doing but every now and then things work. Every now and then things don't work as well!
 

John Big Booty

AWF VIP
Local time
Today, 13:50
Joined
Aug 29, 2005
Messages
8,263
Welcome to the forum.

Congratulations you have just discovered one of the little quirks of continuous forms. Using fields that derive their value from another control on a continuous form are always going to be problematic. As ALL instances of the dependant control will reflect the value held in the record that currently hold focus.

Your best bet to overcome this is to use a query, that brings all the data, you wish to display, together, and use that as the data source of your form.
 

Users who are viewing this thread

Top Bottom