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!

Classes in VBA?

Status
Not open for further replies.

tranchemontaigne

Technical User
Apr 26, 2004
44
US
I have some VB code snippets that use objects to perform matrix math operations.

I would like to use these same code snippets within MS Access 2000 VBA but am experiencing compiler errors when declaring a class.

Is it possible to use objects in Access VBA? Do I need to reference a particular library in order to get objects to compile?

Any thoughts would be appreciated.
 
Objects are possible and very useful in Access. You need to put them in specific Class modules rather than standard Code modules, but you do that in VB too.
What errors are you getting?

Ben

----------------------------------------------
Ben O'Hara "Where are all the stupid people from...
...And how'd they get so dumb?"
rockband.gif
NoFX-The Decline
----------------------------------------------
Want to get great answers to your Tek-Tips questions? Have a look at F
 
Error message: "Compile Error: Expected end of statement"

appears immediately after reading the following lines of code:
--------------------------------------
Option Compare Database
Option Explicit

Public Class MatrixFunctions

--------------------------------------
 
You don't need that line. As long as the code is in a proper class module then all you need are your methods, properties and events.
To name your class, just give it the required name as you save it.

hth

Ben

----------------------------------------------
Ben O'Hara "Where are all the stupid people from...
...And how'd they get so dumb?"
rockband.gif
NoFX-The Decline
----------------------------------------------
Want to get great answers to your Tek-Tips questions? Have a look at F
 
Thanks, commenting that line of code out solved that part of the problem. I still have some more code fixing to make the matrix math work, but will work on that on my own before requesting any additional assistance.
 
No problems. There shouldn't be that many problems, mainly when you are trying to import IDE directives, such as descriptions etc.
If you get really stuck, post what you have and I'm sure someone will be able to help.

Ben

----------------------------------------------
Ben O'Hara "Where are all the stupid people from...
...And how'd they get so dumb?"
rockband.gif
NoFX-The Decline
----------------------------------------------
Want to get great answers to your Tek-Tips questions? Have a look at F
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top