problem with Popup Calendar code for Access 95 (1 Viewer)

Ariid

New member
Local time
Today, 04:05
Joined
Oct 18, 2005
Messages
3
Hi all,
I'm quite new to Access. My problem is that I am developing a database for myself at work. They use access 95. I don't have access to that at home so use Ac 97 and use downsizer to convert it to Ac 95. Everything works fine (with some tweaking) except the popup calendar (I used allen browne's). Access 95 doesn't like some aspects of the code, specifically ;

Public Function CalendarFor(txt As TextBox, Optional strTitle As String)
this code is in the module, and i get an error optional argument must be variant. if i 'fix*' this i get an error on the form when i try to open the calendar (The expression on click you entered as the event property setting produced an error: Type Mismatch) except for 1 textbox on which it works fine.
And;

Private Function SetDate(Unit As String, Optional intStep As integer = 1)
I get an error when compiling-Expected: List seperator or) is this a syntax problem?

*By fix I mean replacing the code with
Public Function CalendarFor(txt As TextBox, Optional strTitle As Variant)
and
Private Function SetDate(Unit As String, Optional intStep As integer)

I need to know whether Iam on a hiding into nothing trying to get this to work on AC 95 or if it will work, can someone point me in the right direction.

Cheers in advance.


Ps the original full code is;

Public Function CalendarFor(txt As TextBox, Optional strTitle As String)
On Error GoTo Err_Handler
'Purpose: Open the calendar form, identifying the text box to return the date to.
'Arguments: txt = the text box to return the date to.
' strTitle = the caption for the calendar form (passed in OpenArgs).

Set gtxtCalTarget = txt
DoCmd.OpenForm "frmCalendar", windowmode:=acDialog, OpenArgs:=strTitle

Exit_Handler:
Exit Function

Err_Handler:
MsgBox "Error " & Err.Number & " - " & Err.Description, vbExclamation, "CalendarFor()"
Resume Exit_Handler
End Function
And
Private Function SelectDate(ctlName As String)
Call SetSelected(ctlName)
Call cmdOk_Click
End Function

Private Function SetDate(Unit As String, Optional intStep As Integer = 1)
On Error GoTo Err_Handler

Me.txtDate = DateAdd(Unit, intStep, Me.txtDate)
Call ShowCal

Exit_Handler:
Exit Function

Err_Handler:
MsgBox "Error " & Err.Number & " - " & Err.Description, vbExclamation, conMod & ".SetDate"
Resume Exit_Handler
End Function
 

Mile-O

Back once again...
Local time
Today, 04:05
Joined
Dec 10, 2002
Messages
11,316
Did ActiveX exist in Access 95?
 

pacg

Registered User.
Local time
Today, 03:05
Joined
Aug 27, 2004
Messages
25
Try to see the Northwind.mdb of MS Access. It has something of a kind.
 

Ariid

New member
Local time
Today, 04:05
Joined
Oct 18, 2005
Messages
3
This is'nt an active X popup its just an ordinary access form.
 

Users who are viewing this thread

Top Bottom