locked
Greater than or equal to?????

    Question

  • I need a little help, i am trying to have the program do a calculation based on where the amount is. so it takes the amount from pay.txt and then needs to figure if its between this amount, so say its 700.00, then i need it to decide is it greater than or equal to 500.00 and less then or equal to 1000.00? any help would be appreciated. 
    Monday, September 15, 2008 5:11 PM

Answers

  • Justspyn said:

    I need a little help, i am trying to have the program do a calculation based on where the amount is. so it takes the amount from pay.txt and then needs to figure if its between this amount, so say its 700.00, then i need it to decide is it greater than or equal to 500.00 and less then or equal to 1000.00? any help would be appreciated. 



    Hi,

    I presume pay is a Textbox?

    If so try this code with one button and a textbox named pay on your FORM.>>




    Public Class Form1

     

        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

     

            Dim amount As Double

            Double.TryParse(pay.Text, amount)

     

            If amount >= 500 And amount <= 1000 Then

                'Your code here.>>

     

            End If

     

        End Sub

    End Class

     

     

     

     

    Regards,

    John

     


    For links to VB.Net tutorials see here.>> http://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/29f2179b-997b-4115-a96d-a0834853b835
    • Marked as answer by Justspyn Tuesday, September 16, 2008 5:18 PM
    Monday, September 15, 2008 10:38 PM

All replies

  • You could try a bunch of if-then statements, or a
    SELECT CASE dblAmount

        Case 0 to 100
            code here for that
        Case 101 to 200
            code here for that
        .
        .
        .
        Case Else
            code for handling out of range situations
    END SELECT

    If the money is coming in from various sources, you could set flags for those sources, and test in the code "code here for that", then handle appropriately.  An example could be whether taxable, or non-taxable, or service fee required, or not, etc.

    Without more information about your need, I really can't offer more.
    Monday, September 15, 2008 7:34 PM
  • Justspyn said:

    I need a little help, i am trying to have the program do a calculation based on where the amount is. so it takes the amount from pay.txt and then needs to figure if its between this amount, so say its 700.00, then i need it to decide is it greater than or equal to 500.00 and less then or equal to 1000.00? any help would be appreciated. 



    Hi,

    I presume pay is a Textbox?

    If so try this code with one button and a textbox named pay on your FORM.>>




    Public Class Form1

     

        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

     

            Dim amount As Double

            Double.TryParse(pay.Text, amount)

     

            If amount >= 500 And amount <= 1000 Then

                'Your code here.>>

     

            End If

     

        End Sub

    End Class

     

     

     

     

    Regards,

    John

     


    For links to VB.Net tutorials see here.>> http://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/29f2179b-997b-4115-a96d-a0834853b835
    • Marked as answer by Justspyn Tuesday, September 16, 2008 5:18 PM
    Monday, September 15, 2008 10:38 PM