View Full Version : Lookup to return Max Value


gwilliam
03-05-2001, 04:24 PM
I have a data input form to maintain a table [tblProduct]
the fields are [Product],[Process],[Part],[CycleTime],[RevDate],[RevLevel].

[Product] and [Process] are not likely to change and a new [Part] required only occasionally. [CycleTime] change will most often drive the need for a new record.
When this happens I would like to ensure the correct [RevLevel] is applied.
I rationalized that DLookup could be used in the default property for [RevLevel] and by adding 1 this would be the [RevLevel] for the new record.

I used =DLookup([tblProduct]![RevLevel],"tblProduct",[Product] & [Process]=[tblProduct]![Product] & [tblProduct]![Process])[Product]&[Process]& [Part] and several iterations of the pesky delimiters then read that the function cannot be used unless the domain is different to that of the form source.

So would appreciate it if someone could give the compass a flick and point me in the right direction!

I havn't got to using VBA Code yet and if this will provide the only solution it will have to wait until I get there, but would like to find an interim solution if there is one.

thanks in advance for any suggestions!

Pat Hartman
03-06-2001, 09:40 AM
Change either the form or the DLookUp() to use a query rather than using the table directly.