Hi everyone ![[smile] [smile] [smile]](/data/assets/smilies/smile.gif)
I wanted to know how to use a calendar form or object to input criteria into a query?
I'm running a query/report and the user has to enter a start date and a finish date.
I have two calendar forms - Calendar and Calendar2 (do I need to calendar objects to do a start and finish date with?)
So in the query I put in the following criteria:
Between [Forms]![Calendar]![Calendar0] And [Forms]![Calendar2]![Calendar0]
and in the calendar update code I put the following code:
Dim stLinkCriteria As String
Dim stDocName As String
stDocName = "DateValiDateDecPsCd"
Set rs = Me.Recordset.Clone
rs.FindFirst "[DATEDECISS] = '" & Me![Calendar0] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
DoCmd.OpenReport stDocName, acViewPreview, stLinkCriteria = rs.EOF
The above code I use for both calendar controls.
I am trying to input the Decision Date (DATEDECISS) via the calendar controls (between to specified dates) hence the Between [Forms]![Calendar]![Calendar0] And [Forms]![Calendar2]![Calendar0]
Please help..
any help would be greatly appreciated.![[bigsmile] [bigsmile] [bigsmile]](/data/assets/smilies/bigsmile.gif)
Kind regards
Triacona
![[smile] [smile] [smile]](/data/assets/smilies/smile.gif)
I wanted to know how to use a calendar form or object to input criteria into a query?
I'm running a query/report and the user has to enter a start date and a finish date.
I have two calendar forms - Calendar and Calendar2 (do I need to calendar objects to do a start and finish date with?)
So in the query I put in the following criteria:
Between [Forms]![Calendar]![Calendar0] And [Forms]![Calendar2]![Calendar0]
and in the calendar update code I put the following code:
Dim stLinkCriteria As String
Dim stDocName As String
stDocName = "DateValiDateDecPsCd"
Set rs = Me.Recordset.Clone
rs.FindFirst "[DATEDECISS] = '" & Me![Calendar0] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
DoCmd.OpenReport stDocName, acViewPreview, stLinkCriteria = rs.EOF
The above code I use for both calendar controls.
I am trying to input the Decision Date (DATEDECISS) via the calendar controls (between to specified dates) hence the Between [Forms]![Calendar]![Calendar0] And [Forms]![Calendar2]![Calendar0]
Please help..
any help would be greatly appreciated.
![[bigsmile] [bigsmile] [bigsmile]](/data/assets/smilies/bigsmile.gif)
Kind regards
Triacona