Andrew Jensen wrote:
Walter A. March wrote:
sub onSearchDate( oEv )
dim dtSearch
dim oForm
oForm = oEv.Source.Model.Parent
dtSearch= oForm.getByName( "dtDateFilter" )
oForm.Filter = "startDate = " & "{D '" & dtSearch.text & "' }"
oForm.ApplyFilter = True
oForm.Reload
end sub
<snip>
Right, note the difference in the date format, 2006-07-30 and 07/30/06.
Here is the catch that has you caught, so to speak. The date control's
text property returns you the short date format and what need is the
date formatted YYYY-MM-DD. So the question how to get that.
figured something like that!
Assuming the control is bound to a database column of type date you can
do this
sub onSearchDate( oEv )
dim dtSearch
dim oForm
oForm = oEv.Source.Model.Parent
dtSearch= oForm.getByName( "dtDateFilter" )
dtVal = dtSearch.BoundField.getDate REM using getdate from the
oForm.Filter = "startDate = " & "{D '" & dtVal.Year & "-" & dtVal.Month
& "-" & dtVal.Day & "' }"
oForm.ApplyFilter = True
oForm.Reload
end sub
the line
dtVal = dtSearch.BoundField.getDate
produces an error of its own:
BASIC Runtime error
Object variable not set
I'm thinkin' it doesn't know getDate... is that in something I need to
reference? the remark does say REM using getdate from the
thanks!
WalterAM
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]