Re: Run-time error'3464'
- From: randria <randria@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 18 Mar 2009 05:53:01 -0700
Thank you both Jerry and John for your helps, it is now working fine. I was
really puzzled because I have used my first code ( using CLng ) somewhere
else and it works fine. I just can t figure out at what condition it does not
work, the main thing is it is working now.
Many thanks.
"John Spencer" wrote:
You need to delimit date literals with the # character..
strLink = "[Due Date] Between #" & CDate(Me![Date3]) & "# AND #" &
CDate(Me![Date4]) & "#")
Another problem is if you are not in the US then you probably need to
force the date format into either the US format of m/d/y or my
preference of yyyy mm dd format.
strLink = "[Due Date] Between #" & Format(Me![Date3],"yyyy-mm-dd") & "#
AND #" & Format(Me![Date4],"yyyy-mm-dd") & "#")
'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
randria wrote:
Thanks Jerry, that got rid of the error 3464 however the query did not return
any record. Here is the correction I made based on your suggestion
strDoc = "2do"
strLink = "[Due Date] Between " & CDate(Me![Date3]) & " AND " &
CDate(Me![Date4])
I tried to put this directly in the criteria of the query: Between
([Forms]![myfrm]![Date3]) And ([Forms]![myfrm]![Date4]), using a new command
btn , the report opened with Data. I cant understand what is wrong with above
code.
Many thanks.
"Jerry Whittle" wrote:
The CLng converts them into a number so they are no longer a date. Maybe you
meant CDate.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.
"randria" wrote:
Hello,
I have a query based report and the following code to open the report
Private Sub Ctl2doCmd_Click()
Dim strDoc As String
Dim strLink As String
strDoc = "2do"
strLink = " [Due Date] Between " & CLng(Me![Date3]) & " AND " &
CLng(Me![Date4])
DoCmd.OpenReport strDoc, acViewPreview, , strLink
I get the above error msg (Data type mismatch ) while [Due Date],[Date3] and
[Date4] have date data type.
Please help, what am I doing wrong ?
Many thanks.
- References:
- Run-time error'3464'
- From: randria
- RE: Run-time error'3464'
- From: Jerry Whittle
- RE: Run-time error'3464'
- From: randria
- Re: Run-time error'3464'
- From: John Spencer
- Run-time error'3464'
- Prev by Date: Re: Summing numbers after a specific date
- Next by Date: RE: query
- Previous by thread: Re: Run-time error'3464'
- Next by thread: Access and Excel 2007 - 65000 rows limitation trouble
- Index(es):
Relevant Pages
|