- Local time
- Today, 07:29
- Joined
- Jan 23, 2006
- Messages
- 15,364
I have created library files (mda) in 2003. I have tried to use that library with Access 2010. It is referenced and shows up in the Project window.
When I try to reference a class module from the library file using the new keyword, I get an error (commented out in red below). However, if I use a class module clsTimer, that is resident in my main database, the New keyword is acceptable.
cStringX can be seen in the library, and methods/properties seen via Object browser. Intellisense show these as well.
Can someone point me to reference materials and examples related to library files using 2010, and/or the issue with the new keyword??
When I try to reference a class module from the library file using the new keyword, I get an error (commented out in red below). However, if I use a class module clsTimer, that is resident in my main database, the New keyword is acceptable.
cStringX can be seen in the library, and methods/properties seen via Object browser. Intellisense show these as well.
Can someone point me to reference materials and examples related to library files using 2010, and/or the issue with the new keyword??
Code:
'---------------------------------------------------------------------------------------
' Procedure : demoClass_CstringX
' Author : mellon
' Date : 08/04/2016
' Purpose :Trying this old class module cStringX.
' Issues with the mda library; having syntax issues trying to use NEW
'---------------------------------------------------------------------------------------
'
Sub demoClass_CstringX()
Dim omystring As cStringX
[COLOR="Red"] 'Set omystring = New cStringX[/COLOR]
On Error GoTo demoClass_CstringX_Error
Set omyString = cStringX
Dim otime As clsTimer
Set otime = New clsTimer
omyString.Value = "This is a test string to show the functionality of this class"
Debug.Print "String value : " & omyString.Value
Debug.Print "String reversed : " & omyString.Reverse
Debug.Print "String Length : " & omyString.Length
Debug.Print "String Starting " & omyString.startingchar
Debug.Print "String Starting 6 chars :" & omyString.startingchar(6)
Debug.Print "String Ending 5 chars :" & omyString.endingchar(6)
Debug.Print "String contains (zz) " & omyString.contains("zz")
Debug.Print "String contains nc " & omyString.contains("nc")
Debug.Print "String has char at position 7: " & omyString.charat(7)
Debug.Print "String upper " & omyString.toProper
Debug.Print "Time taken(ticks): " & otime.EndTimer
On Error GoTo 0
Exit Sub
demoClass_CstringX_Error:
MsgBox "Error " & Err.Number & " in line " & Erl & " (" & Err.Description & ") in procedure demoClass_CstringX of Module Module4"
End Sub
Last edited: