A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

DLast cont...



 
 
Thread Tools Display Modes
  #1  
Old October 24th, 2006, 04:43 PM posted to microsoft.public.access.forms
Beks
external usenet poster
 
Posts: 6
Default DLast cont...

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!


  #2  
Old October 24th, 2006, 05:10 PM posted to microsoft.public.access.forms
Tom Lake
external usenet poster
 
Posts: 193
Default DLast cont...

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



  #3  
Old October 26th, 2006, 07:09 AM posted to microsoft.public.access.forms
John Vinson
external usenet poster
 
Posts: 4,033
Default DLast cont...

On Tue, 24 Oct 2006 08:43:02 -0700, Beks
wrote:

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]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:18 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.