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!

Using class methods in queries and reports 1

Status
Not open for further replies.

SteveCulshaw

Programmer
Oct 13, 2000
48
GB
Is it possible to use class methods in queries and reports??
e.g. I have an address field which needs some processing before use as it comes from a Unix based Oracle database.
I have a function Reformat to do this, but I've got bitten by idea of classes, so I tried a 'TextConversion' class, with .OriginalText and .ReformatText. It works in VBA code, but I can't get at the .ReformatText in queries or reports?

Thanks,
Steve C. [sig][/sig]
 
You have to wrap it in a function and the set the control source of the report to the function.

For example a simple function to convert to upper case.

Public Function Upper(strPassedString) As String

Upper = UCase(strPassedString)

End Function

The field control source on the report becomes =Upper([Field1FromQuery])


[sig]<p>Bill Paton<br><a href=mailto:william.paton@ubsw.com>william.paton@ubsw.com</a><br><a href= Check out my website ![/sig]
 
Bill,
thanks for the reply.
Yeap that works, now I just wonder if I'm getting too hooked on 'classing' everything.
The reason I was asking if this could be done is that I can create the class in a VB ActiveX DLL, then reference the DLL from Access, so keeping common processes / functions in a single place. I can then update / add new classes, and just send out the new DLL to the users.

Any idea what overhead this wrapping has ?

Cheers,
Steve C.
[sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top