DLast cont...

B

Beks

Arggh - I have tried all of the suggestions and am still not quite there. I
think I am so close but missing a key element.

SAMPLEID is the Autonumber (unique) Primary key in ptbl_MASTER_SAMPLE that
links to ptbl_FISH_INDIV. I would like the default value to be the most
recent date entered into the subform (not the entire dataset).

So, from what I Understand, I should use:

DMax("[DATE_VIDEO]","[ptbl_FISH_INDIV]","[SAMPLEID]"="[ptbl_MASTER_SAMPLE].[SAMPLEID]")

But the result is blank. I appreciate your help and your patience (I am a
bit green with these type of controls). Thanks!
 
T

Tom Lake

So, from what I Understand, I should use:
DMax("[DATE_VIDEO]","[ptbl_FISH_INDIV]","[SAMPLEID]"="[ptbl_MASTER_SAMPLE].[SAMPLEID]")

But the result is blank. I appreciate your help and your patience (I am a
bit green with these type of controls). Thanks!

If SAMPLEID is a text field, do this:

DMax("[DATE_VIDEO]","[ptbl_FISH_INDIV]","[SAMPLEID]= '" &
[ptbl_MASTER_SAMPLE].[SAMPLEID] & "'"")

If it's a numeric field, do this:

DMax("[DATE_VIDEO]","[ptbl_FISH_INDIV]","[SAMPLEID]= " &
[ptbl_MASTER_SAMPLE].[SAMPLEID])

Tom Lake
 
J

John Vinson

Arggh - I have tried all of the suggestions and am still not quite there. I
think I am so close but missing a key element.

SAMPLEID is the Autonumber (unique) Primary key in ptbl_MASTER_SAMPLE that
links to ptbl_FISH_INDIV. I would like the default value to be the most
recent date entered into the subform (not the entire dataset).

So, from what I Understand, I should use:

DMax("[DATE_VIDEO]","[ptbl_FISH_INDIV]","[SAMPLEID]"="[ptbl_MASTER_SAMPLE].[SAMPLEID]")

But the result is blank. I appreciate your help and your patience (I am a
bit green with these type of controls). Thanks!


This will find all records where the SampleID caontains the text
string [ptbl_MASTER_SAMPLE].[SAMPLEID]. I doubt that there will be
any...

You need to concatenate the VALUE of [ptbl_MASTER_SAMPLE].[SAMPLEID],
not its name. Try

DMax("[DATE_VIDEO]","[ptbl_FISH_INDIV]","[SAMPLEID]=" &
[ptbl_MASTER_SAMPLE].[SAMPLEID])

This will take the text string "[SAMPLEID]=" and concatenate the value
of the field SAMPLEID from ptbl_MASTER_SAMPLE; if that value is 12651,
you'll get

[SAMPLEID]=12651

and should get the result that you want.

John W. Vinson[MVP]
 
Top