Click to See Complete Forum and Search --> : compile error: method or data member not found


kazooie21
September 28th, 1999, 06:19 PM
I have the following code:
[vbcode]Private Sub cmdCalc_Click()
'calculate value of paperbacks
lblVp.Caption = Val(txtCpaper.Text)* Val(txtNpaper.Text)
[vbcode]

I run it and get the following message:

compile error: method or data member not found

Rufus
September 28th, 1999, 08:16 PM
Make sure that you still have a button named cmdCalc, a label named lblVp and two text boxes named txtCpaper and txtNpaper. Also check your spelling.

It may sound stupid, but it's easy to make this mistake...

That error message is telling you that you don't have an object by one of those names or one of those objects don't have a method that you are trying to use...

Ravi Kiran
September 29th, 1999, 03:42 AM
Use Str for better Format fns to format the value into a string before assigning to Caption.
lblVp.Caption = Format(Val(txtCpaper.Text)* Val(txtNpaper.Text),"####.##")


RK

Dr_Michael
September 29th, 1999, 03:48 AM
Try to change the last row in your code to this one:

lblVp.Caption = cstr(Val(txtCpaper.Text)* Val(txtNpaper.Text))



Did it work???

Michael Vlastos
Automation Engineer
Company Modus SA
Development Department