Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

default value (max from table) 1

Status
Not open for further replies.

matrixindicator

IS-IT--Management
Sep 6, 2007
418
BE
On my form I have a dropdownbox. The row source is a group by query of dates field. As default value the combobox should give the most recent date available (I created a query within it the max function on the date field).
Now I try to get this value as my default value. But this gives an error. #name ?

Code:
=[queryname].[maxdate]

syntax problem ?
 
You cannot refer to a query in that way. I seems that you need DMax:

[tt]=DMax("DateFieldName","TableName")[/tt]

You can use a Where statement with DMax, if you wish:

[tt]=DMax("DateFieldName","TableName","ID=" & [txtANumber] & " Company='" & [txtText] & "'")[/tt]


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top