
Pleeeeaaase Help... School Project Due
I normally don't like helping students do their assignments, but your case
is different, being that it looks like you've already done most of the
coding...
Assets is an object, your calling the method "Add" , which Visual Basic is
that's why this errors occuring.
Now, if your using a class, you need to create an instance of that class.
Firstly, use correct naming convention, go to your Assets Class Module, and
rename it to "clsAssets"
In the General Declarations section of the form that your calling that
"Assets.Add" function , add this:
Private Assets As clsAssets
Then in the Form_Load event add this:
Set clsAssets = New clsAssets
Then run the project again and you should be able to run it sucessfully.
If you still fail, ensure your Add sub/function is Public in the clsAssets
Class Module, otherwise its only available to that Class.
Hope that gets your assignment in!
Best Regards,
Tim
Quote:
> I keep getting this annoying Runtime Error 438 saying that "Object doesn't
> support the property or method", when I have already written the method
for
> it in the class module! For example:
> I'd type
> Assets.add (TheAsset)
> I've already written the code for the 'add' subroutine in the Assets
class,
> and VB recognizes it because the autocomplete lists it. Yet I keep
getting
> the same old Error 438!
> add is a public sub, so's there's no reason why it shouldn't work.
> I have VB 6.
> Pleeeeeeeease anyhelp would be appreciated, I'm trying to get a school
> project done
> Thanks ahead of time.