Good Morning,
The code below loads the data into my userform with no issue, but I need to load the userform and have the combobox1 options load also straight away instead of basing the combobox1 data on a change of the userform once its loaded.
I am confused on how to get this to work?
Should this be based where it is or adjusted in the actual userform once its loaded and if so where would I put the code concerning "Combobox1"
thanks
Gavin
The code below loads the data into my userform with no issue, but I need to load the userform and have the combobox1 options load also straight away instead of basing the combobox1 data on a change of the userform once its loaded.
I am confused on how to get this to work?
Should this be based where it is or adjusted in the actual userform once its loaded and if so where would I put the code concerning "Combobox1"
thanks
Gavin
Code:
Dim myBook As Workbook
Dim iRow As Long
Dim FYV_Sht As Worksheet
Dim lRow As Integer
Dim I As Long
Dim gotcha As Boolean
Dim cCell As Variant
Dim MyEnquiryNo As String
Dim MyFind As Object
Application.ScreenUpdating = False
MyEnquiryNo = Sheets("Today").Range("C17").Value
Sheet2.Visible = True
If MyEnquiryNo = "" Then
MsgBox "Please enter Reference number to search"
Sheets("Today").Range("C17").Select
Else
Set FYV_Sht = ActiveWorkbook.Sheets("Import Open")
FYV_Sht.Select
Set MyFind = FYV_Sht.Columns(1).Find(What:=MyEnquiryNo, lookat:=xlWhole, SearchDirection:=xlNext)
If Not MyFind Is Nothing Then
iRow = MyFind.Row
Worked.Show False
Worked.txtdate.Value = Cells(iRow, 1)
Worked.txtdate.Locked = True
Worked.TextBox3.Value = Cells(iRow, 2)
Worked.ETType.Value = Cells(iRow, 7)
Worked.ETType.Locked = True
Worked.Rdate.Value = Cells(iRow, 3)
Worked.Rdate.Locked = True
Worked.TextBox4.Value = Cells(iRow, 8)
Worked.TextBox5.Value = Cells(iRow, 9)
Worked.TextBox6.Value = Cells(iRow, 10)
Worked.TextBox7.Value = Cells(iRow, 13)
Worked.TextBox2.Value = Cells(iRow, 14)
Sheet2.Visible = xlVeryHidden
Sheet1.Select
Else
MsgBox "Unable to Find " & MyEnquiryNo & ". Please try another Complaint/Enquiry.", vbOKOnly, "Manager Not Found"
Sheet2.Visible = xlVeryHidden
Sheets("Today").Select
Range("C17").Select
End If
If ETType = "Complaint" Then
With ComboBox1
.AddItem "Complaint Pended - Awaiting Customer Info"
.AddItem "Complaint Pended - Awaiting Escalation work"
.AddItem "Complaint Pended - Awaiting Fault"
.AddItem "Complaint Pended - Awaiting Site Visit"
.AddItem "Complaint Pended - No Contact Process Initiated"
.AddItem "Complaint Pended - To work"
.AddItem "Complaint Closed - Assigned to Hit Team"
.AddItem "Complaint Closed - Customer Satisfied"
.AddItem "Complaint Closed - DEADLOCK"
.AddItem "Complaint Closed - No Contact Process Followed"
.AddItem "Complaint Closed - NFACC"
End With
If ETType = "Enquiry" Then
With ComboBox1
.AddItem "Enquiry Pended - Awaiting Customer Info"
.AddItem "Enquiry Pended - Awaiting Escalation work"
.AddItem "Enquiry Pended - Awaiting Fault"
.AddItem "Enquiry Pended - Awaiting Site Visit"
.AddItem "Enquiry Pended - No Contact Process Initiated"
.AddItem "Enquiry Pended - To work"
.AddItem "Enquiry Closed - Assigned to Hit Team"
.AddItem "Enquiry Closed - Customer Satisfied"
.AddItem "Enquiry Closed - DEADLOCK"
.AddItem "Enquiry Closed - No Contact Process Followed"
.AddItem "Enquiry Closed - NFACC"
End With
End If
End If
End If
End Sub