I was tasked with taking our current mail out enrollment form and converting it to a template that will be downloadable from our website. The customer will be able to fill out the form via 23 textboxes, 4 option buttons, 3 comboboxes as dropdowns and clicking one button that attaches the completed form to an OL email and sending to us. It is simple and only one page in length.
I have a lot if not most of this done but have a problem or two (or more that I don't know of).
The form is working to some extent but when the email button is clicked that part of the program saves the complete form (which is ok) but then the next time the form is opened, all of the info from the previous use is still there; I need it to be a clean slate - reset -cleared etc.
I am NOT a programmer and have learned what I know to this point on the fly.
If there is someone willing to help I am pasting my exact code as it currently exists and maybe you can tell me what I need to complete this task. I want to believe that it is something simple that I am missing but have no clue since I don't know VB.
CODE:
Private Sub EnrollmentForm_Activate()
ComboBox1 = "PROGRAMMING_LIST"
ComboBox2 = "MECHANICAL_LIST"
ComboBox3 = "ELECTRICAL_LIST"
CreditCard1 = False
CreditCard2 = False
CreditCard3 = False
CreditCard4 = False
TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
TextBox4 = ""
TextBox5 = ""
TextBox6 = ""
TextBox7 = ""
TextBox8 = ""
TextBox9 = ""
TextBox10 = ""
TextBox11 = ""
TextBox12 = ""
TextBox13 = ""
TextBox14 = ""
TextBox15 = ""
TextBox16 = ""
TextBox17 = ""
TextBox18 = ""
TextBox19 = ""
TextBox20 = ""
TextBox21 = ""
TextBox22 = ""
TextBox23 = ""
End Sub
Private Sub ComboBox1_DropButtonClick()
Me.ComboBox1.List = Split("PROGRAMMING_LIST Fanuc_Horizontal_Milling_March14-18 Fanuc_Horizontal_Milling_June20-24 Fanuc_Horizontal_Milling_September12-16 Fanuc_Horizontal_Milling_December5-9 Fanuc_Vertical_Turning_January_31-February_4 Fanuc_Vertical_Turning_June_20-24 Fanuc_Vertical_Turning_September_12-16 Fanuc_Vertical_Turning_December_5-9 Siemens_840D_Standard_Programming_Horizontal_Milling_March_21-25 Siemens_840D_Standard_Programming_Horizontal_Milling_June_27-July_1 Siemens_840D_Standard_Programming_Horizontal_Milling_September_26-30 Siemens_840D_Standard_Programming_Horizontal_Milling_December_12-16 Siemens_840D_Standard_Programming_Vertical_Turning_February_21-25 Siemens_840D_Standard_Programming_Vertical_Turning_May_23-27 Siemens_840D_Standard_Programming_Vertical_Turning_August_15-19 Siemens_840D_Standard_Programming_Vertical_Turning_November_28-December_2 Siemens_840D_Advanced_Programming_All_Machines_March_1-4 Siemens_840D_Advanced_Programming_All_Machines_September_20-23 SPECIAL_REQUEST")
End Sub
Private Sub ComboBox2_DropButtonClick()
Me.ComboBox2.List = Split("MECHANICAL_LIST Mechanical_HBM_480/485_January_24-28 Mechanical_HBM_480/485_April_25-29 Mechanical_HBM_480/485_July_18-22 Mechanical_HBM_480/485_October_31-November_4 Mechanical_HBM_486_Consult_Factory Mechanical_HMC_568_February_14-18 Mechanical_VTC_524/525/526_March_7-11 Mechanical_VTC_524/525/526_June_6-10 Mechanical_VTC_524/525/526_September_12-16 Mechanical_VTC_524/525/526_December_5-9 Mechanical_VTC_523_Consult_Factory SPECIAL_REQUEST")
End Sub
Private Sub ComboBox3_DropButtonClick()
Me.ComboBox3.List = Split("ELECTRICAL_LIST Electrical_Fanuc_310i_January_17-21 Electrical_Fanuc_310i_April_4-8 Electrical_Fanuc_310i_July_11-15 Electrical_Fanuc_310i_October_3-7 Electrical_Siemens_840D_February_7-11 Electrical_Siemens_840D_May_2-6 Electrical_Siemens_840D_August_1-5 Electrical_Siemens_840D_November_7-11 SPECIAL_REQUEST")
End Sub
Private Sub CommandButton1_Click()
Dim OL As Object
Dim EmailItem As Object
Dim Doc As Document
Application.ScreenUpdating = False
Set OL = CreateObject("Outlook.Application")
Set EmailItem = OL.CreateItem(olMailItem)
Set Doc = ActiveDocument
Doc.Save
With EmailItem
.Subject = "MAG Fond du Lac Training Enrollment"
.Body = "Training Administrator," & vbCrLf & vbCrLf & _
"Please enroll our employee in your customer training class per the attached form" & vbCrLf & vbCrLf & _
"Thank You"
.To = "engineeringtrain_do@mag-ias.com"
.Importance = olImportanceNormal
.Attachments.Add Doc.FullName
.Display
' .Send
End With
Application.ScreenUpdating = True
Set Doc = Nothing
Set OL = Nothing
Set EmailItem = Nothing
End Sub
Private Sub CreditCard1_Click()
End Sub
Private Sub CreditCard2_Click()
End Sub
Private Sub CreditCard3_Click()
End Sub
Private Sub CreditCard4_Click()
End Sub
Private Sub TextBox1_Change()
End Sub
Private Sub TextBox10_Change()
End Sub
Private Sub TextBox11_Change()
End Sub
Private Sub TextBox12_Change()
End Sub
Private Sub TextBox13_Change()
End Sub
Private Sub TextBox14_Change()
End Sub
Private Sub TextBox15_Change()
End Sub
Private Sub TextBox16_Change()
End Sub
Private Sub TextBox17_Change()
End Sub
Private Sub TextBox18_Change()
End Sub
Private Sub TextBox19_Change()
End Sub
Private Sub TextBox2_Change()
End Sub
Private Sub TextBox20_Change()
End Sub
Private Sub TextBox21_Change()
End Sub
Private Sub TextBox22_Change()
End Sub
Private Sub TextBox23_Change()
End Sub
Private Sub TextBox3_Change()
End Sub
Private Sub TextBox4_Change()
End Sub
Private Sub TextBox5_Change()
End Sub
Private Sub TextBox6_Change()
End Sub
Private Sub TextBox7_Change()
End Sub
Private Sub TextBox8_Change()
End Sub
Private Sub TextBox9_Change()
End Sub