wiklendt
i recommend chocolate
- Local time
- Today, 13:04
- Joined
- Mar 10, 2008
- Messages
- 1,746
hi everyone.
i have a form. i would like to return the max date from, a field in a table which is not bound to anything on that form, into a form textbox control on the form.
googling around (and searching this forum), i've only found threads where people are wanting to get max values from subforms, and a few obscure date things that aren't really related to my issue.
i've tried:
and
in the control itself but both return either #error or #name? or "compile error: expected expression" other colourful variation on an error.
i've also has a stab in the dark with SQL in VBA...
also, i copy/pasted the max sql from a query i made to generate the SQL (running the query returned the expected result), however, when i put the following into the immediate window
it gives me
i have a form. i would like to return the max date from, a field in a table which is not bound to anything on that form, into a form textbox control on the form.
googling around (and searching this forum), i've only found threads where people are wanting to get max values from subforms, and a few obscure date things that aren't really related to my issue.
i've tried:
Code:
=DMax(DateModified,"tblRLBtargets")
Code:
=DLOOKUP(DateModified,"tblRLBtargets",Max(tblRLBtargets.DateModified))
i've also has a stab in the dark with SQL in VBA...
Code:
Dim strSQL As String
strSQL = "SELECT Max(tblRLBtargets.DateModified) AS MaxDate FROM tblRLBtargets;"
DoCmd.RunSQL strSQL
Me.txtLastModified.Value = '?? but how to get result into here ??
Code:
?SELECT Max(tblRLBtargets.DateModified) AS MaxDate FROM tblRLBtargets;
... so i don't know where to take it from here. any suggestions?compile error: expected expression