MSCAL.ocx replacement and associated collateral damage

valleyoak62

New member
Local time
Today, 05:07
Joined
Feb 27, 2012
Messages
4
I modified a program that was developed in MS Access 2000 to get rid of a deprecated feature, MSCAL.ocx, and replace with a date picker. I am currently using MS Access 2010 for troubleshooting and to attempt to get this program to have 100% functionality in the latest version of Access.

Problem is now that I replaced the MSCAL.ocx with text boxes, date format, and show picker I get a different error. On the main form I click a button that takes me to where the calendars used to be (begin date and end date) and get the error: "Object doesn’t support this property or method”.

I click ok to this error, and then enter dates using the picker and when that is executed it is asking me for the Date parameter and then the Format parameter.

What am I missing? Any help or direction would be greatly appreciated!!
 
There's no way for us to tell you without seeing what code is being used.
 
Appreciate your help -

The event procedure that is triggered onclick for the timesheet (that uses the date picker) is:

Private Sub MenuTimeCard_Click()
On Error GoTo Err_MenuTimeCard_Click
DoCmd.OpenForm "MenuTimeCard"
[Forms]![MenuTimeCard]![Begin_Date].Today
[Forms]![MenuTimeCard]![End_Date].Today

Exit_MenuTimeCard_Click:
Exit Sub

Err_MenuTimeCard_Click:
MsgBox Err.Description
Resume Exit_MenuTimeCard_Click

End Sub

Clicking the time card button results in an error: "Object doesn't support this property or method"
 
this is the part that is wrong:

[Forms]![MenuTimeCard]![Begin_Date].Today
[Forms]![MenuTimeCard]![End_Date].Today


With Access 2007 and above you would not use code for the date picker, just the text boxes which would get the value from each click on the calendar that pops up when you enter the text box and click on the little calendar icon.
 
Bob - I think that may have resolved the problem! I am going to test it on 2010 on another computer tonight. Thank you!

Another quick question.. I understand there is an ActiveX control for the calendar (mscal.ocx). Does this control also have to be removed?
 
Bob - I think that may have resolved the problem! I am going to test it on 2010 on another computer tonight. Thank you!

Another quick question.. I understand there is an ActiveX control for the calendar (mscal.ocx). Does this control also have to be removed?

Yes, it does. It has been deprecated in Access 2010. It will cause problems if not removed.
 
Everything seems to have resolved itself with one exception, (and I can't figure out why this is occurring with one form and not another because the same change was made on both...). I am getting an error when I try to print the timesheet portion. It is requesting a date parameter and a format parameter. Here is the code that is executed onclick:

Private Sub Print_TimeCard_Click()
On Error GoTo Err_Print_TimeCard_Click

Dim stDocName As String
If [Forms]![MenuTimeCard]![Project_Num] = "" Then
MsgBox "Please Select a Job Number", vbOKOnly, "ATTENTION"
Else
DoCmd.Minimize
If [Forms]![MenuTimeCard]![Print_All] = True Then
stDocName = "TimeCard_All_Emps"
DoCmd.OpenReport stDocName, acPreview
Else
If [Forms]![MenuTimeCard]![Employee] = "" Then
MsgBox "Please Select an Employee", vbOKOnly, "ATTENTION"
Else
stDocName = "TimeCard"
DoCmd.OpenReport stDocName, acPreview
End If
End If
End If

Exit_Print_TimeCard_Click:
Exit Sub

Err_Print_TimeCard_Click:
MsgBox Err.Description
Resume Exit_Print_TimeCard_Click

End Sub



Thanks for all your help -
 

Users who are viewing this thread

Back
Top Bottom