Consulting

Results 1 to 3 of 3

Thread: Solved: userform...when click OK button ask if the input values are true if not put them agai

  1. #1
    VBAX Contributor PaSha's Avatar
    Joined
    Nov 2007
    Location
    Slovenia
    Posts
    104
    Location

    Solved: userform...when click OK button ask if the input values are true if not put them agai

    helo..

    i made some code for my userform... which when the user clicks the OK button asks him if the values he puted into the inputbox are correct ...

    the code looks like this :

    [VBA]
    Private Sub potrdibutton_Click()


    Dim Config As Integer
    Dim Ans As Integer
    Dim Msg As String
    Config = vbYesNo + vbQuestion + vbDefaultButton2
    Msg = "Ali so naslednji vpisani podatki pravilni?" & vbCrLf & vbCrLf
    Msg = Msg & "?tevilka produkta: " & produktbox & " " & vbCrLf
    Msg = Msg & "?tevilka tipa: " & typbox & " " & vbCrLf
    Msg = Msg & "?tevilka naloga: " & auftragsbox & ""
    Ans = MsgBox(Msg, Config)
    If Ans = vbYes Then ContinueProcedure = True _
    Else
    Exit sub

    'the rest of the code for the ok button

    [/VBA]

    OK this works, when he clicks a pop up windows ask's him if the code is true ... but i want that if the user clicks OK the other code in the button should run if he clicks NO button then he could repair his mistake in the form and then again click ok...

    but i don't no how to do this ... i trayed with continue procedure and exit sub ... but it doesn't work ...

    so hope someone can help me
    I like to help others... but sometimes i also need help ...

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]
    Private Sub potrdibutton_Click()
    Dim Config As Integer
    Dim Ans As Integer
    Dim Msg As String

    Config = vbYesNo + vbQuestion + vbDefaultButton2
    Msg = "Ali so naslednji vpisani podatki pravilni?" & vbCrLf & vbCrLf
    Msg = Msg & "Številka produkta: " & produktbox & " " & vbCrLf
    Msg = Msg & "Številka tipa: " & typbox & " " & vbCrLf
    Msg = Msg & "Številka naloga: " & auftragsbox & "" Ans =
    MsgBox(Msg, Config)

    If Ans = vbno Then

    Exit Sub
    Else

    'the rest of the code for the ok button
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Contributor PaSha's Avatar
    Joined
    Nov 2007
    Location
    Slovenia
    Posts
    104
    Location

    Thumbs up

    oh ok, lol, i forgotten the answer no...

    thank you...

    solved...
    I like to help others... but sometimes i also need help ...

Posting Permissions

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