![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Apr 2005
Posts: 2
Rep Power: 0
![]() |
VB Help
hey..im reading a book called "Sams Teach Yourself Visual Basic 6 in 21 Days"
and i need help with one of the "simple" projects in there! \\ here is the code: Private Sub cmdCalcPay_Click() ' Computes three payroll variables Dim intHoursWorked As Integer Dim sngRate As Single, sngTaxRate As Single Dim curTaxes As Currency, curGrossPay As Currency Dim curNetpay As Currency ' Intialize the variables ' (Normally, data such as this would ' come from the user or from a file) intHoursWorked = 40 ' Total hours worked sngRate = 7.8 ' Pay per hour sngTaxRate = 0.42 ' Tax rate percentage ' Calculate the amounts curGrossPay = intHoursWorked * sngRate curTaxes = sngTaxRate * curGrossPay curNetpay = curGrossPay - curTaxes ' Display results in appropriate labels lblGrossPay.Caption = curGrossPay lblTaxes.Caption = curTaxes lblNetPay.Caption = curNetpay End Sub when i compile and run..etc. it says: -- COMPILE ERROR: method or data member not found -- when it is debugged: it highlights in yellow: Private Sub cmdCalcPay_Click() and it highlights in Blue: lblGrossPay.Caption = curGrossPay --it highlights the ".Caption =" bit --- id really appreciate any help!..cause im just learning!...thanx! |
|
|
|
|
|
#2 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Are you using Visual Basic, or Visual Basic .NET? I believe they changed it to LabelName.Text in VB .NET.
|
|
|
|
|
|
#3 |
|
Programmer
Join Date: Apr 2005
Posts: 32
Rep Power: 0
![]() |
Hi,
Check whether the name property of the command button control placed on the form is correct or not. To do: First double click on the command button then sub procedure will be displayed. Place the code and compile it once again. Regards bharathi Books for programmers http://www.vkinfotek.com |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|