I had a working calendar, kindly helped out by Adezii, but since I upgraded to 2007 a couple of days ago the Calendar no longer works. The error message shown is "Error in fPopulateTempTable(), You must enter a value in the 'tblEventTemp.Start Date' field."
This I believe comes from the section
Private Function fPopulateTempTable() As BooleanBut I don't understand why! Nothing has changed apart from the upgrade, ive even checked by copying and pasting from a backup of the Calendar I had into another 2007 Access document and it wont work there either!
On Error GoTo Err_fPopulateTempTable
Dim MyDB As DAO.Database
Dim rstEvent As DAO.Recordset
Dim rstEventTemp As DAO.Recordset
Dim intCounter As Integer
Set MyDB = CurrentDb
Set rstEvent = MyDB.OpenRecordset("tblEvent", dbOpenForwardOnly)
Set rstEventTemp = MyDB.OpenRecordset("tblEventTemp", dbOpenDynaset)
CurrentDb.Execute "Delete * From tblEventTemp", dbFailOnError
With rstEvent
If Not .BOF And Not .EOF Then
Do While Not .EOF
If DateDiff("d", ![Start Date], ![End Date]) > 0 Then
For intCounter = 0 To DateDiff("d", ![Start Date], ![End Date])
rstEventTemp.AddNew
rstEventTemp![Start Date] = DateAdd("d", intCounter, ![Start Date])
rstEventTemp![End Date] = ![End Date]
rstEventTemp![Order Type] = ![Order Type]
rstEventTemp![EventID] = ![EventID]
rstEventTemp![Organization Name] = ![Organization Name]
rstEventTemp![Event Start] = ![Start Date]
rstEventTemp.Update
Next
Else
rstEventTemp.AddNew
rstEventTemp![Start Date] = ![Start Date]
rstEventTemp![End Date] = ![End Date]
rstEventTemp![Order Type] = ![Order Type]
rstEventTemp![EventID] = ![EventID]
rstEventTemp![Organization Name] = ![Organization Name]
rstEventTemp![Event Start] = ![Start Date]
rstEventTemp.Update
End If
.MoveNext
Loop
rstEvent.Close
rstEventTemp.Close
Set rstEvent = Nothing
Set rstEventTemp = Nothing
Else
End If
End With
fPopulateTempTable = True
Exit_fPopulateTempTable:
Exit Function
Err_fPopulateTempTable:
fPopulateTempTable = False
MsgBox Err.Description, vbCritical, "Error in fPopulateTempTable()"
Resume Exit_fPopulateTempTable
End Function
Help, I was feeling so happy for a while!