Results 1 to 2 of 2

Thread: Addition Problem

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2000
    Location
    Illinois
    Posts
    27

    Unhappy

    I have to type a single number into the input box then you hit the plus key. This will make that number be added to whatever is in the display box. Then you type a new number in to the input box and hit the plus key again and now this new number will be added to what is in the display and the sum will again be put in the display box. For this one I have to use the case statement and the plus sign must not show up on the form.

    I'm a MICKEY FAN

  2. #2
    Guest
    Try this:
    txtInputBox represents your input box.
    txtDisplayBox represents your display box.
    Code:
    Private Sub txtInputBox_KeyPress(KeyAscii As Integer)
        If Chr(KeyAscii) = "+" Then
            KeyAscii = 0
            txtDisplayBox.Text = Val(txtDisplayBox.Text) + Val(txtInputBox.Text)
            txtInputBox.Text = ""
        End If
    End Sub
    I hope this helps.

    [Edited by Sc0rp on 09-25-2000 at 04:05 PM]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width