|
-
Mar 26th, 2005, 02:42 AM
#1
Thread Starter
Banned
employee app
for x = 1 to 3
employee = InputBox("Enter employee#")
hoursworked = InputBox("Enter hoursworked")
payrate = InputBox("Enter pay rat")
print hoursworked,payrate,employee,hoursworked *payrate
next x
Last edited by crocker; Mar 26th, 2005 at 03:42 AM.
Reason: RESOLVED
-
Mar 26th, 2005, 02:43 AM
#2
Re: employee app
You want it to print on a form?
-
Mar 26th, 2005, 02:47 AM
#3
Thread Starter
Banned
Re: employee app
How do I get it to pop up a messagebox where I can click OK
Last edited by crocker; Mar 26th, 2005 at 03:42 AM.
-
Mar 26th, 2005, 02:50 AM
#4
Re: employee app
msgbox ("Your pay is: " & format(hoursworked *payrate, "$$$.00")
-
Mar 26th, 2005, 03:03 AM
#5
Banned
Re: employee app
Dim a
Private Sub Command1_Click()
End
End Sub
Private Sub Form_Load()
For x = 1 To 3
employee = InputBox("Enter employee#")
hoursworked = InputBox("Enter hoursworked")
payrate = InputBox("Enter pay rat")
a = hoursworked * payrate
MsgBox "hoursworked, paypayrate, employee"
MsgBox a
Next x
End Sub
-
Mar 26th, 2005, 03:11 AM
#6
Re: employee app
nonono!
like so:
VB Code:
Dim a as integer
dim exployee as string
dim hoursworked as integer
dim payrate as integer
Private Sub Command1_Click()
End
End Sub
Private Sub Form_Load()
employee = InputBox("Enter employee#")
hoursworked = InputBox("Enter hours worked")
payrate = InputBox("Enter pay rate")
a = hoursworked * payrate
MsgBox "hoursworked, paypayrate, employee " & a
End Sub
-
Mar 26th, 2005, 03:36 AM
#7
Banned
Re: employee app
VB Code:
Dim a As Integer
Dim exployee As String
Dim hoursworked As Integer
Dim payrate As Integer
Private Sub Command1_Click()
End
End Sub
Private Sub Form_Load()
For x = 1 To 3
employee = InputBox("Enter employee#")
hoursworked = InputBox("Enter hoursworked")
payrate = InputBox("Enter pay rat")
a = hoursworked * payrate
MsgBox "hoursworked, paypayrate, employee " & a
Next x
End Sub
-
Mar 26th, 2005, 03:41 AM
#8
Fanatic Member
P.S. God Love You And Have A Good Day!!! My web page
I need to get a free Iphone
-
Mar 26th, 2005, 04:21 AM
#9
PowerPoster
Re: employee app
 Originally Posted by dos5731
VB Code:
Dim a As Integer
Dim exployee As String
Dim hoursworked As Integer
Dim payrate As Integer
Private Sub Command1_Click()
End
End Sub
Private Sub Form_Load()
For x = 1 To 3
employee = InputBox("Enter employee#")
hoursworked = InputBox("Enter hoursworked")
payrate = InputBox("Enter pay rat")
a = hoursworked * payrate
MsgBox "hoursworked, paypayrate, employee " & a
Next x
End Sub
I agree with dos5731 because the original post has to input 3 employees.
-
Mar 26th, 2005, 07:09 AM
#10
Re: employee app
 Originally Posted by dos5731
VB Code:
Dim a As Integer
Dim exployee As String
Dim hoursworked As Integer
Dim payrate As Integer
Private Sub Command1_Click()
End
End Sub
Private Sub Form_Load()
For x = 1 To 3
employee = InputBox("Enter employee#")
hoursworked = InputBox("Enter hoursworked")
payrate = InputBox("Enter pay rat")
a = hoursworked * payrate
MsgBox "hoursworked, paypayrate, employee " & a
Next x
End Sub
"a" should not be integer - it should be currency. Actually, they all need to be currency - do not use DOUBLE or SINGLE!
a = hoursworked * payrate should be a = round(hoursworked * payrate,2). And be consistent - rounding errors are a nightmare in commercial payroll development.
MsgBox "hoursworked, paypayrate, employee " & a should be
MsgBox "hoursworked, paypayrate, employee " & Cstr(a)
Respect your datatypes and do not allow VB to coerce them - always wrap in a function to match all datatypes in an expression.
With that said:
hoursworked = CCur(InputBox("Enter hoursworked"))
You will need some kind of error trapping - this can blow up if odd values (non numeric) are entered.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|