+ Reply to Thread
Results 1 to 6 of 6

pop up form within userform to confirm choice

  1. #1
    Forum Contributor
    Join Date
    06-03-2008
    MS-Off Ver
    Excel 2007 (also have access to Excel 2000/2003)
    Posts
    368

    pop up form within userform to confirm choice

    Hi,

    I have a button within a userform that clears the form:

    Please Login or Register  to view this content.
    What I want is when it is clicked the userform ClearCheck is shown that basically asks - Are you sure you wish to continue Yes/No.

    If Yes I want the rest of the above Sub to continue. If No then Stop.

    Can you advise. The ClearCheck code is below:

    Please Login or Register  to view this content.
    Thank you in advance.
    Last edited by jpruffle; 05-11-2009 at 12:13 PM.

  2. #2
    Registered User
    Join Date
    04-22-2009
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    47

    Re: pop up form within userform to confirm choice

    Sub Msgbox_Yes_No()
    Dim Response As Integer
    Response = MsgBox(prompt:="Select 'Yes' or 'No'.", Buttons:=vbYesNo)
    ' if user selects yes, i would like to macro(Yes) to continue running
    If Response = vbYes Then
    Resume
    Else
    ' if the user selects no, exit or whtevr code

    End If
    End Sub
    you could use a message box for this case and that could be even fired from any worksheet or workbook event
    Last edited by ravinder_tigh; 05-11-2009 at 05:26 AM.
    Thanks & Regards
    Ravinder S
    (Ravinder_tigh)

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: pop up form within userform to confirm choice

    As suggested just use a message box
    Please Login or Register  to view this content.
    This would be simpler
    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Forum Contributor
    Join Date
    06-03-2008
    MS-Off Ver
    Excel 2007 (also have access to Excel 2000/2003)
    Posts
    368

    Re: pop up form within userform to confirm choice

    Thank you both for your suggestions.

    Roy I like your idea of clearing the form without referencing. But two things: Firstly my form is a multipage form and I would like the ability for the button just to clear page1 for example (The button resides on Page1). Secondly is there a way to omit two of the items from being cleared:

    ComboBox - SelectAct1
    and a textbox - ActNumber1?

    Thanks in advance.

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: pop up form within userform to confirm choice

    You can't use the second method, this would reset all textboxes, etc

  6. #6
    Forum Contributor
    Join Date
    06-03-2008
    MS-Off Ver
    Excel 2007 (also have access to Excel 2000/2003)
    Posts
    368

    Re: pop up form within userform to confirm choice

    Thank you for your advice.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1