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:
thanks in advanceCode: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
***EDIT:
It the adding a different sections and my app it passes this value as base to next count




Reply With Quote