Results 1 to 11 of 11

Thread: [RESOLVED] InputBox ... a little prob

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2005
    Location
    in Poland
    Posts
    390

    Resolved [RESOLVED] InputBox ... a little prob

    Hi

    My prob:

    If I click on a Cancel button I want that my app pass to end (also after making first entry - line of code : If MsgBox("You have incomplete value or you want to break?".....)
    Unfortunately it's around displaying me message "Enter with correct an value".
    Also I get the error when I click on a button OK in InputBox when nothing is entered. Because my Sum variable is Empty. How to make it correctly


    It's my code:

    Code:
     
    Option Explicit
    
    Dim intNext As Integer
    
    Private Sub cmdOK_Click()
    
    Dim I As Integer, War As String, Sum As Double
    
    intNext = Text2.Text
    
    For I = 0 To intNext
    
    Again:
      War = InputBox("Added   " & I + 1 & "   value", "Adding sections")
        If StrPtr(War) = 0 Then 'Exit Sub
    
            If Sum > 0 Then
              If MsgBox("You have incomplete value or you want to break?", _
              vbYesNo + vbQuestion, "Question") = vbYes Then Exit Sub
            End If
    
            If IsNumeric(War) = False Then
              MsgBox "Enter with correct an value", vbCritical
            GoTo Again
            End If
        End If
    Sum = Sum + CDbl(War)
    Next
    
    Text1.Text = Sum
    
    
    End Sub
    thanks in advance

    ***EDIT:

    It the adding a different sections and my app it passes this value as base to next count
    Last edited by Tamgovb; Apr 29th, 2007 at 04:52 AM.
    I know, I know, my English is bad, sorry .....

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