Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Jul 2005
    Location
    Minneapolis, Minnesota, USA
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Why can't I make this dialog box disappear? (Word2K/WindowsXp)

    This is my second user form/dialog box. I can get all the other ones to disappear or hide, but this one sticks around until you actually end the entire thing.

    Any ideas?



    Private Sub cmdCancel_Click()
    Me.Hide

    End Sub

    Private Sub cmdNext_Click()

    'moves data from textboxes to form

    If chbx1.Value = True Then
    ActiveDocument.Bookmarks("ShAgt").Select
    ActiveDocument.AttachedTemplate.AutoTextEntries("S HAgt").Insert _
    Where:=Selection.Range, RichText:=True
    ElseIf chbx1.Value = False Then
    ActiveDocument.Bookmarks("ShAgt").Delete
    Selection.Delete Unit:=wdCharacter, Count:=1
    End If

    If chbx2.Value = True Then
    ActiveDocument.Bookmarks("Sec1244").Select
    ActiveDocument.AttachedTemplate.AutoTextEntries("S ec1244").Insert _
    Where:=Selection.Range, RichText:=True
    ElseIf chbx2.Value = False Then
    ActiveDocument.Bookmarks("Sec1244").Delete
    Selection.Delete Unit:=wdCharacter, Count:=1
    End If

    If chbx3.Value = True Then
    ActiveDocument.Bookmarks("Form").Select
    ActiveDocument.AttachedTemplate.AutoTextEntries("F orm").Insert _
    Where:=Selection.Range, RichText:=True
    Selection.GoTo What:=wdGoToBookmark, Name:="FormParValue"
    Selection.TypeText Text:=txtbxFormParValue.Text
    ElseIf chbx3.Value = False Then
    ActiveDocument.Bookmarks("Form").Delete
    Selection.Delete Unit:=wdCharacter, Count:=1
    End If

    If chbx4.Value = True Then
    ActiveDocument.Bookmarks("SubS").Select
    ActiveDocument.AttachedTemplate.AutoTextEntries("S ubS").Insert _
    Where:=Selection.Range, RichText:=True
    ElseIf chbx4.Value = False Then
    ActiveDocument.Bookmarks("SubS").Delete
    Selection.Delete Unit:=wdCharacter, Count:=1
    End If

    If chbx7.Value = True Then
    ActiveDocument.Bookmarks("br2").Select
    ActiveDocument.AttachedTemplate.AutoTextEntries("b r2").Insert _
    Where:=Selection.Range, RichText:=True
    Selection.TypeParagraph
    Selection.GoTo What:=wdGoToBookmark, Name:="CorpBank"
    Selection.TypeText Text:=txtCorpBank.Text
    ElseIf chbx7.Value = False Then
    ActiveDocument.Bookmarks("br2").Delete
    Selection.Delete Unit:=wdCharacter, Count:=1
    End If

    If opt5.Value = True Then
    SubAgtOpt1.Show
    ElseIf opt5.Value = False Then
    ActiveDocument.Bookmarks("SubAgt1").Delete
    Selection.Delete Unit:=wdCharacter, Count:=1
    End If

    If opt6.Value = True Then
    SubAgtOpt2.Show
    ElseIf opt6.Value = False Then
    ActiveDocument.Bookmarks("SubAgt2").Delete
    Selection.Delete Unit:=wdCharacter, Count:=1
    End If

    End


    'unload current form and hide it
    SubAgt1.Hide
    Unload SubAgt1
    '
    '
    ''load the next form and get the information from access table for Author's initials
    ''and then show it
    Load frmSigBlock
    frmSigBlock.Show

    End Sub


    Private Sub UserForm_Click()

    End Sub

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Why can't I make this dialog box disappear? (W

    There is a lone End in one of your procedures, which will halt execution at that point. Was that your intent, or was it supposed to be End+something else?

Posting Permissions

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