PDA

Click to See Complete Forum and Search --> : object required


stingrae
Jan 20th, 2003, 05:00 AM
please help this VB programmer get off the ground in web programming! :rolleyes:

all i'm trying to do is have a text box display the result of a box indicating quantity, and a drop down of products, with the price in the value fields. too simple compared to some of the code i've seen pasted here!

anyway, here's what i had originally:

function AddTotal
txtTotalDue.value = txtOrderQty01.value * sltOrderProduct01.value
end function


when calling this function from "sltOrderProduct01_onchange", all that happens is I get an "Object Required" error message.

I then decided to make it even simpler and made it:

txtTotalDue.value = 100 * 24

but this gives me the same error message! :confused:
i know that txtTotalDue has to exist, as it gives me autocomplete!

please, anyone care to assist this one? (as he looks for his L plates)

MrNorth
Jan 20th, 2003, 12:49 PM
Where have you declared the object on which the addtotal function is a member? Perhaps it is just am matter of encapsulated objects, meaning that you don't have access to that function from where you are trying to call it. How have you declared the object btw? As static or dim or private or whatever?

kind regards
Henrik

Redth
Jan 20th, 2003, 01:29 PM
most likely though, you should be using .Text, not .value :D

txtTotalDue.Text

not

txtTotalDue.value

stingrae
Jan 20th, 2003, 03:11 PM
guys, thanks for the help.

1. No I haven't declared the objects. How do i do this?
2. There is no member .Text, only .Value.

:confused:
thanks