DLookup update

awake2424

Registered User.
Local time
Today, 01:27
Joined
Oct 31, 2007
Messages
479
Code:
 =DLookUp("[Kit]","tblExtraction","[Inuse] = -1")

The above code pulls the lot # of a kit from a table Extraction where the field is checked in-use. If on the 11 record the in-use changes how can the previous 10 records remain unchanged?

For example,
Record 1-10 Kit 1234 is in-use and so is populated into the form. However, on record 11, Kit 5678 is put in-use. The previous 10 records did not use this kit and need to be unchanged, but record 11 on until the in-use changes needs to be updated. Thanks.
 
I'm really suspicious of your data structure, but the short answer may be DMax(), sorting on some sort of DateTimePutInUse field (DESCending, of course).

The longer answer is that you need to think about how your data is organized. How is Access supposed to know that for record 11 5678 is In Use, but 1-10 1234 is In Use?
 
Code:
 DMax("Kit", "tblTest", "Inuse = -1")

in the table I set Inuse to decending, is this not correct? Thank you.
 
Code:
 [tblTest].[Date] DESC, [tblTest].[Inuse]

Whenever the Inuse is checked that is what populates the form.

I need the records that already had values in them to remain unchanged. Thanks.
 
I can't see the relation between the DLookup and the need to populate a table.
DLookup extract a value (and only one - the first one) from field Kit where the record Inuse value = True. This function will not populate the table. Am I wrong ?
 

Users who are viewing this thread

Back
Top Bottom