Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 24th, 2003, 05:21 PM
ASHY ASHY is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: SCOTLAND
Posts: 4 ASHY User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old November 24th, 2003, 06:29 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,976 Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 17 h 59 m 48 sec
Reputation Power: 802
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Need Help With A Problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT