[RESOLVED] Monthview DayBold & Overflow Error
I have a monthview control on my form and I want certain days to show up bold using the following code:
Code:
Public Function HighlightCalendar(ByVal strCRNumber As String, strReviewDate As Date)
Dim rsDateList As ADODB.RecordSet
Set rsDateList = New ADODB.RecordSet
Dim strDate As String
Dim strSql As String
strDate = Format(strReviewDate, "MM/DD/YYYY")
strSql = "SELECT Location.Location_Date " & _
"FROM Master_Review INNER JOIN Location ON Master_Review.ID = Location.ID " & _
"Where Master_Review.CR_Number = '" & strCRNumber & "' And Master_Review.Review_Date = " & "#" & strDate & "#" & _
"ORDER BY Location.Location_Date"
With rsDateList
.Open strSql, conAccess, adOpenStatic, adLockOptimistic
Do While Not .EOF
frmMain.monReviewDates.DayBold(.Fields!Location_Date) = True
Loop
End With
End Function
On the line I've highlighted above though, I get an "Overflow 6" error. What is causing this?
Re: Monthview DayBold & Overflow Error
What is the value of .Fields!Location_Date at the time of error?
Re: Monthview DayBold & Overflow Error
08/04/2009. Oddly enough, if I hard code a date of 09/09/2009 it works.
If I hard-code 08/04/2009 it craps out again. Hmm.
Re: Monthview DayBold & Overflow Error
What data type is Location_Date field?
Also what is the max and min date of the monthview control set to?
Re: Monthview DayBold & Overflow Error
It's a date/time field in Access formatted as mm/dd/yyyy
Re: Monthview DayBold & Overflow Error
and what is the max and min date of the monthview control set to?
Re: Monthview DayBold & Overflow Error
Ok Try this... this will work. Just add this one line
vb Code:
frmMain.monReviewDates.Value = .Fields!Location_Date
frmMain.monReviewDates.DayBold(.Fields!Location_Date) = True
Apparently Monthview gives an error if the date you want to make bold is not displayed.