rockwellsba
10-26-2009, 11:32 AM
Hello- I would appreciate anyone's help on this.
I have a UserForm (UserForm1) with the following code in General/Declarations:
Private Sub CommandButton1_Click()
'' Validate all TextBoxes
If TextBox1.Text = "" Then
MsgBox "Name Of Applicant field is not complete"
TextBox1.SetFocus
Exit Sub
End If
If TextBox2.Text = "" Then
MsgBox "Contact Name field is not complete"
TextBox2.SetFocus
Exit Sub
End If
If TextBox3.Text = "" Then
MsgBox "Applicant Phone field is not complete"
TextBox3.SetFocus
Exit Sub
End If
'If we got here, textboxes have valid input
'Put valid inputs into document
With ActiveDocument
.Bookmarks("NameOfApplicant").Range _
.InsertBefore TextBox1.Text
.Bookmarks("ContactName").Range _
.InsertBefore TextBox2.Text
.Bookmarks("ApplicantPhone").Range _
.InsertBefore TextBox3.Text
End With
''We got this far, must be ready to close the dialog
Unload Me
'End If
End Sub
I also have UserForm2 which is the Splash Screen. Its code (in UserForm/Initialize) is:
Private Sub UserForm_Initialize()
Application.OnTime Now + TimeValue("00:00:05"), "KillForm"
End Sub
I have two modules. Module1 (General/Autonew) code:
Sub autonew()
'
' autonew Macro
'
'
UserForm1.Show
End Sub
Module2 (General/KillForm) code:
Sub KillForm()
Unload UserForm2
End Sub
And lastly, code for ThisDocument (Document/Open):
Private Sub Document_Open()
UserForm2.Show
End Sub
When I open the template, the splash screen (UserForm2) does not show. UserForm1 shows up just fine. Any help would be greatly appreciated. Thank you!
I have a UserForm (UserForm1) with the following code in General/Declarations:
Private Sub CommandButton1_Click()
'' Validate all TextBoxes
If TextBox1.Text = "" Then
MsgBox "Name Of Applicant field is not complete"
TextBox1.SetFocus
Exit Sub
End If
If TextBox2.Text = "" Then
MsgBox "Contact Name field is not complete"
TextBox2.SetFocus
Exit Sub
End If
If TextBox3.Text = "" Then
MsgBox "Applicant Phone field is not complete"
TextBox3.SetFocus
Exit Sub
End If
'If we got here, textboxes have valid input
'Put valid inputs into document
With ActiveDocument
.Bookmarks("NameOfApplicant").Range _
.InsertBefore TextBox1.Text
.Bookmarks("ContactName").Range _
.InsertBefore TextBox2.Text
.Bookmarks("ApplicantPhone").Range _
.InsertBefore TextBox3.Text
End With
''We got this far, must be ready to close the dialog
Unload Me
'End If
End Sub
I also have UserForm2 which is the Splash Screen. Its code (in UserForm/Initialize) is:
Private Sub UserForm_Initialize()
Application.OnTime Now + TimeValue("00:00:05"), "KillForm"
End Sub
I have two modules. Module1 (General/Autonew) code:
Sub autonew()
'
' autonew Macro
'
'
UserForm1.Show
End Sub
Module2 (General/KillForm) code:
Sub KillForm()
Unload UserForm2
End Sub
And lastly, code for ThisDocument (Document/Open):
Private Sub Document_Open()
UserForm2.Show
End Sub
When I open the template, the splash screen (UserForm2) does not show. UserForm1 shows up just fine. Any help would be greatly appreciated. Thank you!