Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 20th, 2005, 4:34 AM   #1
bh4575
Newbie
 
Join Date: Apr 2005
Posts: 2
Rep Power: 0 bh4575 is on a distinguished road
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!
bh4575 is offline   Reply With Quote
Old Apr 20th, 2005, 10:22 AM   #2
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Are you using Visual Basic, or Visual Basic .NET? I believe they changed it to LabelName.Text in VB .NET.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Apr 21st, 2005, 12:50 AM   #3
Bharathi
Programmer
 
Join Date: Apr 2005
Posts: 32
Rep Power: 0 Bharathi is on a distinguished road
Smile Sample Project code

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
Bharathi is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:12 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC