|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Need Help With A Problem
Hi
Iam doing an exercise for college which requires the use of a IF THEN ELSE statement. The problem is as follows: A Salesman is paid a monthly salary of £1,500, however is his sales are over £20,000 his monthly slary is £1,800. Here is my code: Private Sub Command1_Click() Dim Details As String, MonthlySales As Integer, Value As Integer Details = InputBox("Please Enter Your Full Name") MonthlySales = InputBox("Please Enter Your Total Value Of Sales For The Month In Pounds") Value = txtmonthlysales If Value <= 20000 Then Text1.Text = 1500 ElseIf Value > 20000 Then Text1.Text = 1800 Else End End If End Sub The problem is if I enter over £20,000 in the Input Box Text1.txt is displaying the salesman's wages as 1500 which is wrong as it should be displaying 1800. Can anyone help please as Iam new to visual basic (go easy on me) Many Thanks Ashy Ok Iam new to Visual Basic |
|
#2
|
|||
|
|||
|
First, please read the post "how to post a question" so you'll know acceptable subject lines.
Second, generally homework questions don't get answered directly, but as a hint I suspect your value in txtMonthlySales isn't numeric. You didn't post the code where you set txtMonthlySales. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Need Help With A Problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|