Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calendar control's value property acting strange

Status
Not open for further replies.

Jables

Programmer
Aug 28, 2001
148
US
I have a form with the Microsoft Calendar Control 7.0 on it. There is a subform that gets filtered by the date selected on the calendar. When the form loads, the following happens:
Code:
Me.axCal.Value = FormatDateTime(Now(), vbShortDate)
'Code debugs to the line below
Me.frmtime_subform.Form.Filter = "[Date Worked] = #" & _
                                 Me.axCal.Value & "#"
Me.frmtime_subform.Form.OrderBy = "[Date Worked],[Started]"
Me.frmtime_subform.Form.FilterOn = True
Me.frmtime_subform.Form.OrderByOn = True
This code works fine, but here's where it gets weird. Every third time I open the form, I get an error that debugs to the commented line above. The error is:

Err.Number: 2455
Err.Descriptoin: You entered an expression that has an invalid reference to the property. The property may not exist or may not apply to the object you specified.

Even stranger is that when I say every third time, I mean that error pops up when doing the following:

1) open the form twice
2) get the error on the third time the form is opened
3) close the form
4) open it once more
5) CLOSE ACCESS
6) open the application again
7) open the form once more with no errors
8) close it again
9) open it the third time, AND THE ERROR APPEARS AGAIN.

So the pattern seems to carry through even after Access is completely shut down and open again. I'm stuck. Any help would be greatly appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top