Pleeeeaaase Help... School Project Due 
Author Message
 Pleeeeaaase Help... School Project Due

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.



Wed, 18 Jun 1902 08:00:00 GMT  
 Pleeeeaaase Help... School Project Due
bah,

what ya mean by assets?



Wed, 18 Jun 1902 08:00:00 GMT  
 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.



Wed, 18 Jun 1902 08:00:00 GMT  
 Pleeeeaaase Help... School Project Due


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)

<cut>

I think you are barking up the wrong tree.  Assuming that "TheAsset" is
an object reference then that syntax is trying to evaluate the
expression (theAsset{.<defaultproperty>}).  If there is no default
property you get the error you mentioned.  The correct syntax is:
Call Assets.Add(TheAsset) ' use parens when you use Call
--or--
Assets.Add TheAsset ' omit them when you omit Call

--
Please reply via the newsgroup only

Sent via Deja.com http://www.deja.com/
Before you buy.



Thu, 22 May 2003 10:18:25 GMT  
 Pleeeeaaase Help... School Project Due
Try:    Assets.add "TheAsset"  or Assets.add TheAsset


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.



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. School project help in vb

2. school project need help now

3. Need Help on a school project

4. Urgent Help needed for School Project!!

5. School project help in vb

6. school project ... help

7. Project Due Help Needed

8. Project Due Help Needed

9. project for school

10. PROJECT DUE BY WEDSNDAY AND NOT FINISHED YET

11. SCHOOL PROJECT

12. school project in VB6

 

 
Powered by phpBB® Forum Software