Hello,
I have a User Form that I got from www.onlinepclearning.com (great tutorials!) I am using it to search, add, edit and delete customers. The code is written to save the customers in the same book where the User Form is in. However, this book is on our company network and multiple people are using it. Only the first user to open it is able to save changes so everything the rest of the users do is lost. All the sheets in the workbook are template so only a copy of the filled out forms is being saved, leaving the template in it's original form. I don't want anyone to save any changes to the templates so saving changes to the customer database is not happening.
I am trying to change the code so the customer database is stored in a stand alone workbook saved in the same place as the template workbook. When adding, searching, editing or deleting customers the User Form uses the "Customer Database" workbook. The code is sending the customer information to multiple templates in the workbook so it's pretty long.
I have been struggling with this a over a month hoping I would be able to make the changes to the code myself but have had no luck. Everyone is getting pretty frustrated that they can't save new customers.
I would be extremely grateful form some help on this on.
Private Sub cboInvoiceType_Change()
If Me.cboInvoiceType = "Supply Only" Then
Sheet1.Range("K17:K40").Value = "Y"
Sheet5.Range("K17:K40").Value = "Y"
End If
If Me.cboInvoiceType = "Supply & Install" Then
Sheet1.Range("K17:K40").Value = "N"
Sheet5.Range("K17:K40").Value = "N"
End If
End Sub
Private Sub cmbSendToInvoice_Click()
Dim answer As String
Dim ws As Worksheet
Set ws = Worksheets("Invoice")
'Clear out Job # on all sheets before adding new customer
Sheet20.Range("D5").Value = ""
Sheet21.Range("E5").Value = ""
Sheet23.Range("D5").Value = ""
Sheet24.Range("E5").Value = ""
Sheet25.Range("E5").Value = ""
Sheet26.Range("E5").Value = ""
Sheet27.Range("E5").Value = ""
Sheet28.Range("E5").Value = ""
Sheet29.Range("E5").Value = ""
Sheet38.Range("D5").Value = ""
Sheet40.Range("E5").Value = ""
Sheet1.Range("B16").Value = cboInvoiceType.Value
Sheet5.Range("B16").Value = cboInvoiceType.Value
'Send Staff name to all work orders
Sheet31.Range("G9").Value = txtSales.Value
Sheet20.Range("E5").Value = txtSales.Value
Sheet21.Range("F5").Value = txtSales.Value
Sheet23.Range("E5").Value = txtSales.Value
Sheet24.Range("F5").Value = txtSales.Value
Sheet25.Range("F5").Value = txtSales.Value
Sheet26.Range("F5").Value = txtSales.Value
Sheet27.Range("F5").Value = txtSales.Value
Sheet28.Range("F5").Value = txtSales.Value
Sheet29.Range("F5").Value = txtSales.Value
Sheet33.Range("A7").Value = txtSales.Value
Sheet38.Range("E5").Value = txtSales.Value
Sheet40.Range("F5").Value = txtSales.Value
'Send Job Location to all work orders
Sheet20.Range("A11").Value = txtJobLocation.Value
Sheet21.Range("A11").Value = txtJobLocation.Value
Sheet24.Range("A11").Value = txtJobLocation.Value
Sheet25.Range("A11").Value = txtJobLocation.Value
Sheet26.Range("A11").Value = txtJobLocation.Value
Sheet27.Range("A11").Value = txtJobLocation.Value
Sheet28.Range("A11").Value = txtJobLocation.Value
Sheet29.Range("A11").Value = txtJobLocation.Value
Sheet38.Range("A11").Value = txtJobLocation.Value
Sheet40.Range("A11").Value = txtJobLocation.Value
'Send City to all work orders
Sheet20.Range("F11").Value = txtCity.Value
Sheet21.Range("F11").Value = txtCity.Value
Sheet24.Range("G11").Value = txtCity.Value
Sheet25.Range("G11").Value = txtCity.Value
Sheet26.Range("G11").Value = txtCity.Value
Sheet27.Range("G11").Value = txtCity.Value
Sheet28.Range("G11").Value = txtCity.Value
Sheet29.Range("G11").Value = txtCity.Value
Sheet38.Range("F11").Value = txtCity.Value
Sheet40.Range("G11").Value = txtCity.Value
'Send Customer Name to all work orders
Sheet20.Range("A9").Value = Emp2.Value
Sheet21.Range("A9").Value = Emp2.Value
Sheet23.Range("A9").Value = Emp2.Value
Sheet24.Range("A9").Value = Emp2.Value
Sheet25.Range("A9").Value = Emp2.Value
Sheet26.Range("A9").Value = Emp2.Value
Sheet27.Range("A9").Value = Emp2.Value
Sheet28.Range("A9").Value = Emp2.Value
Sheet29.Range("A9").Value = Emp2.Value
Sheet38.Range("A9").Value = Emp2.Value
Sheet40.Range("A9").Value = Emp2.Value
'Send Phone number to work orders
Sheet20.Range("E9").Value = Emp4.Value
Sheet21.Range("F9").Value = Emp4.Value
Sheet23.Range("E9").Value = Emp4.Value
Sheet24.Range("F9").Value = Emp4.Value
Sheet25.Range("F9").Value = Emp4.Value
Sheet26.Range("F9").Value = Emp4.Value
Sheet27.Range("F9").Value = Emp4.Value
Sheet28.Range("F9").Value = Emp4.Value
Sheet29.Range("F9").Value = Emp4.Value
Sheet38.Range("E9").Value = Emp4.Value
Sheet40.Range("F9").Value = Emp4.Value
'Send Cell number to work orders
Sheet20.Range("F9").Value = Emp6.Value
Sheet21.Range("G9").Value = Emp6.Value
Sheet23.Range("F9").Value = Emp6.Value
Sheet24.Range("G9").Value = Emp6.Value
Sheet25.Range("G9").Value = Emp6.Value
Sheet26.Range("G9").Value = Emp6.Value
Sheet27.Range("G9").Value = Emp6.Value
Sheet28.Range("G9").Value = Emp6.Value
Sheet29.Range("G9").Value = Emp6.Value
Sheet38.Range("F9").Value = Emp6.Value
Sheet40.Range("G9").Value = Emp6.Value
'send information to invoice
Sheet1.Range("B10").Value = Emp2.Value
Sheet1.Range("B11").Value = Emp3.Value
Sheet1.Range("B12").Value = Emp4.Value
Sheet1.Range("B13").Value = Emp5.Value
Sheet1.Range("E12").Value = Emp6.Value
Sheet1.Range("B14").Value = Emp8.Value
Sheet1.Range("B1").Value = Emp9.Value
Sheet1.Range("H45").Value = Emp7.Value
Sheet1.Range("I12").Value = txtSales.Value
'send information to quote
Sheet5.Range("B10").Value = Emp2.Value
Sheet5.Range("B11").Value = Emp3.Value
Sheet5.Range("B12").Value = Emp4.Value
Sheet5.Range("B13").Value = Emp5.Value
Sheet5.Range("E12").Value = Emp6.Value
Sheet5.Range("B14").Value = Emp8.Value
Sheet5.Range("B1").Value = Emp9.Value
Sheet5.Range("H45").Value = Emp7.Value
Sheet5.Range("I12").Value = txtSales.Value
'send inforamtion to Work Sheet
Sheet19.Range("B5").Value = Emp2.Value
Sheet19.Range("B6").Value = Emp3.Value
Sheet19.Range("B7").Value = Emp4.Value
Sheet19.Range("B8").Value = Emp5.Value
Sheet19.Range("D7").Value = Emp6.Value
Sheet19.Range("G7").Value = txtSales.Value
'send inforamtion to Receipt
Sheet18.Range("B10").Value = Emp2.Value
Sheet18.Range("B11").Value = Emp3.Value
Sheet18.Range("B12").Value = Emp4.Value
Sheet18.Range("B13").Value = Emp5.Value
Sheet18.Range("E12").Value = Emp6.Value
Sheet18.Range("B14").Value = Emp8.Value
Sheet18.Range("I12").Value = txtSales.Value
Unload Me
End Sub
Private Sub cmdAdd_Click()
'dimention the variable
Dim DataSH As Worksheet
Dim addme As Range
'set the variable
Set DataSH = Sheet2
'error handler
On Error GoTo ErrHandler:
'set variable for the destination
Set addme = DataSH.Cells(Rows.Count, 3).End(xlUp).Offset(1, 0)
'hold in memory and stop screen flicker
Application.ScreenUpdating = False
If Me.txtName = "" Or Me.txtAddress = "" Or Me.txtPSTRate = "" Or Me.txtPrintCopies = "" Then
MsgBox "There is missing information, Please return and add the needed information"
Exit Sub
End If
Sheet1.Range("B16").Value = cboInvoiceType.Value
Sheet5.Range("B16").Value = cboInvoiceType.Value
'Send Staff name to all work orders
Sheet31.Range("G9").Value = txtSales.Value
Sheet20.Range("E5").Value = txtSales.Value
Sheet21.Range("F5").Value = txtSales.Value
Sheet23.Range("E5").Value = txtSales.Value
Sheet24.Range("F5").Value = txtSales.Value
Sheet25.Range("F5").Value = txtSales.Value
Sheet26.Range("F5").Value = txtSales.Value
Sheet27.Range("F5").Value = txtSales.Value
Sheet28.Range("F5").Value = txtSales.Value
Sheet29.Range("F5").Value = txtSales.Value
Sheet33.Range("A7").Value = txtSales.Value
Sheet38.Range("E5").Value = txtSales.Value
Sheet40.Range("F5").Value = txtSales.Value
'Send Job Location to all work orders
Sheet20.Range("A11").Value = txtJobLocation.Value
Sheet21.Range("A11").Value = txtJobLocation.Value
Sheet24.Range("A11").Value = txtJobLocation.Value
Sheet25.Range("A11").Value = txtJobLocation.Value
Sheet26.Range("A11").Value = txtJobLocation.Value
Sheet27.Range("A11").Value = txtJobLocation.Value
Sheet28.Range("A11").Value = txtJobLocation.Value
Sheet29.Range("A11").Value = txtJobLocation.Value
Sheet38.Range("A11").Value = txtJobLocation.Value
Sheet40.Range("A11").Value = txtJobLocation.Value
'Send City to all work orders
Sheet20.Range("F11").Value = txtCity.Value
Sheet21.Range("F11").Value = txtCity.Value
Sheet24.Range("G11").Value = txtCity.Value
Sheet25.Range("G11").Value = txtCity.Value
Sheet26.Range("G11").Value = txtCity.Value
Sheet27.Range("G11").Value = txtCity.Value
Sheet28.Range("G11").Value = txtCity.Value
Sheet29.Range("G11").Value = txtCity.Value
Sheet38.Range("F11").Value = txtCity.Value
Sheet40.Range("G11").Value = txtCity.Value
'Send Customer Name to all work orders
Sheet20.Range("A9").Value = txtName.Value
Sheet21.Range("A9").Value = txtName.Value
Sheet23.Range("A9").Value = txtName.Value
Sheet24.Range("A9").Value = txtName.Value
Sheet25.Range("A9").Value = txtName.Value
Sheet26.Range("A9").Value = txtName.Value
Sheet27.Range("A9").Value = txtName.Value
Sheet28.Range("A9").Value = txtName.Value
Sheet29.Range("A9").Value = txtName.Value
Sheet38.Range("A9").Value = txtName.Value
Sheet40.Range("A9").Value = txtName.Value
'Send Phone number to work orders
Sheet20.Range("E9").Value = txtPhone.Value
Sheet21.Range("F9").Value = txtPhone.Value
Sheet23.Range("E9").Value = txtPhone.Value
Sheet24.Range("F9").Value = txtPhone.Value
Sheet25.Range("F9").Value = txtPhone.Value
Sheet26.Range("F9").Value = txtPhone.Value
Sheet27.Range("F9").Value = txtPhone.Value
Sheet28.Range("F9").Value = txtPhone.Value
Sheet29.Range("F9").Value = txtPhone.Value
Sheet38.Range("E9").Value = txtPhone.Value
Sheet40.Range("F9").Value = txtPhone.Value
'Send Cell number to work orders
Sheet20.Range("F9").Value = txtCell.Value
Sheet21.Range("G9").Value = txtCell.Value
Sheet23.Range("E9").Value = txtCell.Value
Sheet24.Range("F9").Value = txtCell.Value
Sheet25.Range("F9").Value = txtCell.Value
Sheet26.Range("F9").Value = txtCell.Value
Sheet27.Range("F9").Value = txtCell.Value
Sheet28.Range("F9").Value = txtCell.Value
Sheet29.Range("F9").Value = txtCell.Value
Sheet38.Range("E9").Value = txtCell.Value
Sheet40.Range("G9").Value = txtCell.Value
'send information to invoice
Sheet1.Range("B10").Value = txtName.Value
Sheet1.Range("B11").Value = txtAddress.Value
Sheet1.Range("B12").Value = txtPhone.Value
Sheet1.Range("B13").Value = txtEmail.Value
Sheet1.Range("B14").Value = txtPSTNumber.Value
Sheet1.Range("B1").Value = txtPrintCopies.Value
Sheet1.Range("H45").Value = txtPSTRate.Value
Sheet1.Range("I12").Value = txtSales.Value
'send information to quote
Sheet5.Range("B10").Value = txtName.Value
Sheet5.Range("B11").Value = txtAddress.Value
Sheet5.Range("B12").Value = txtPhone.Value
Sheet5.Range("B13").Value = txtEmail.Value
Sheet5.Range("B14").Value = txtPSTNumber.Value
Sheet5.Range("B1").Value = txtPrintCopies.Value
Sheet5.Range("H45").Value = txtPSTRate.Value
Sheet5.Range("I12").Value = txtSales.Value
'send inforamtion to Work Sheet
Sheet19.Range("B5").Value = txtName.Value
Sheet19.Range("B6").Value = txtAddress.Value
Sheet19.Range("B7").Value = txtPhone.Value
Sheet19.Range("B8").Value = txtEmail.Value
Sheet19.Range("G7").Value = txtSales.Value
'send inforamtion to Receipt
Sheet18.Range("B10").Value = txtName.Value
Sheet18.Range("B11").Value = txtAddress.Value
Sheet18.Range("B12").Value = txtPhone.Value
Sheet18.Range("B13").Value = txtEmail.Value
Sheet18.Range("B14").Value = txtPSTNumber.Value
Sheet18.Range("I12").Value = txtSales.Value
'send the values to the database
With DataSH
'add the unique reference ID then all other values
addme.Offset(0, -1) = DataSH.Range("C6").Value + 1
addme.Value = Me.txtName
addme.Offset(0, 1).Value = Me.txtAddress.Value
addme.Offset(0, 2).Value = Me.txtPhone.Value
addme.Offset(0, 3).Value = Me.txtCell.Value
addme.Offset(0, 4).Value = Me.txtEmail.Value
addme.Offset(0, 5).Value = Me.txtPSTRate.Value
addme.Offset(0, 6).Value = Me.txtPSTNumber.Value
addme.Offset(0, 7).Value = Me.txtPrintCopies.Value
End With
'sort the data by "Name"
DataSH.Select
With DataSH
.Range("B9:J10000").Sort Key1:=Range("C9"), Order1:=xlAscending, Header:=xlGuess
End With
'clear the values after entry
' Clear
'communicate with the user
MsgBox "Customer was successfully added."
Unload Me
'return to interface sheet sheet
Sheet37.Select
'reset the form
On Error GoTo 0
Exit Sub
ErrHandler:
'if error occurs then show me exactly where the error occurs
MsgBox "Error " & Err.Number & _
" (" & Err.Description & ")in procedure cmdClear_Click of Form CustomerDB"
End Sub
Private Sub cmdAddToInvoice_Click()
Dim answer As String
Dim ws As Worksheet
Set ws = Worksheets("Invoice")
Range("B16").Value = cboInvoiceType.Value
If Me.txtSales = "" Or Me.cboInvoiceType = "" Then
MsgBox "There is missing information, Please return and add the needed information."
Exit Sub
End If
'send information to invoice
Range("B10").Value = txtName.Value
Range("B11").Value = txtAddress.Value
Range("B12").Value = txtPhone.Value
Range("B13").Value = txtEmail.Value
Range("B14").Value = txtPSTNumber.Value
Range("B1").Value = txtPrintCopies.Value
Range("I12").Value = txtSales.Value
Range("H45").Value = txtPSTRate.Value
Unload Me
End Sub
Private Sub cmdClear_Click()
Me.txtName = ""
Me.txtAddress = ""
Me.txtPhone = ""
Me.txtEmail = ""
Me.txtCell = ""
Me.txtPSTNumber = ""
Me.txtPrintCopies = ""
Me.txtSales = ""
Me.txtPSTRate = ""
Me.txtCity = ""
Me.txtJobLocation = ""
Me.cboHeader = ""
Me.cboInvoiceType = ""
Me.Emp1 = ""
Me.Emp2 = ""
Me.Emp3 = ""
Me.Emp4 = ""
Me.Emp5 = ""
Me.Emp6 = ""
Me.Emp7 = ""
Me.Emp8 = ""
Me.Emp9 = ""
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdContact_Click()
'Get Customer
'dim the variables
Dim Crit As Range
Dim FindMe As Range
Dim DataSH As Worksheet
'error handler
On Error GoTo ErrHandler:
'set object variables
Set DataSH = Sheet2
'hold in memory and stop screen flicker
Application.ScreenUpdating = False
If Me.txtSales = "" Or Me.cboInvoiceType = "" Then
MsgBox "There is missing information, Please return and add the needed information."
Exit Sub
End If
'///////////////////////////////////////////
'if header is selected add the criteria
If Me.cboHeader.Value <> "All_Columns" Then
If Me.txtSearch = "" Then
DataSH.Range("L9") = ""
Else
DataSH.Range("L9") = "*" & Me.txtSearch.Value & "*"
End If
End If
'//////////////////////////////////////////
'if all columns is selected
If Me.cboHeader.Value = "All_Columns" Then
'find the value in the column
Set FindMe = DataSH.Range("B9:J10000").Find(What:=txtSearch, LookIn:=xlValues, _
Lookat:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
'variable for criteria header
Set Crit = DataSH.Cells(8, FindMe.Column)
'if no criteria is added to the search
If Me.txtSearch = "" Then
DataSH.Range("L9") = ""
DataSH.Range("L8") = ""
Else
'add values from the search
DataSH.Range("L8") = Crit
If Crit = "ID" Then
DataSH.Range("L9") = Me.txtSearch.Value
Else
DataSH.Range("L9") = "*" & Me.txtSearch.Value & "*"
End If
'show in the userform the header that is added
Me.txtAllColumn = DataSH.Range("L8").Value
End If
End If
'/////////////////////////////////////////
'unprotect all sheets
Unprotect_All
'filter the data
DataSH.Range("B8").CurrentRegion.AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Range("Customers!$L$8:$L$9"), CopyToRange:=Range("Customers!$N$8:$V$8"), _
Unique:=False
'add the dynamic data to the listbox
lstCustomers.RowSource = DataSH.Range("outdata").Address(external:=True)
'protect all sheets
Protect_All
'error handler
On Error GoTo 0
Exit Sub
ErrHandler:
'Protect all sheets
Protect_All
'if error occurs then show me exactly where the error occurs
MsgBox "No match found for " & txtSearch.Text
'clear the listbox if no match is found
Me.lstCustomers.RowSource = ""
Exit Sub
End Sub
Private Sub cboHeader_Change()
'dim the variable
Dim DataSH As Worksheet
'set the variable
Set DataSH = Sheet2
'establish the condition for "All_Columns"
If Me.cboHeader.Value = "All_Columns" Then
DataSH.Range("L8") = ""
Else
'clear the textbox
Me.txtAllColumn = ""
'add the criteria header to the sheet
DataSH.Range("L8") = Me.cboHeader.Value
'clear any existing criteria
DataSH.Range("L9") = ""
End If
End Sub
Private Sub cmdDelete_Click()
'Delete a customer
'declare the variables
Dim findvalue As Range
Dim cDelete As VbMsgBoxResult
Dim cNum As Integer
Dim DataSH As Worksheet
Set DataSH = Sheet2
Dim X As Integer
'error statement
On Error GoTo ErrHandler:
'hold in memory and stop screen flicker
Application.ScreenUpdating = False
'check for values
If Emp1.Value = "" Or Emp2.Value = "" Then
MsgBox "There is not data to delete"
Exit Sub
End If
'give the user a chance to change their mind
cDelete = MsgBox("Are you sure that you want to delete this Customer?", _
vbYesNo + vbDefaultButton2, "Are you sure?")
If cDelete = vbYes Then
'find the row
Set findvalue = DataSH.Range("B:B").Find(What:=Me.Emp1.Value, _
LookIn:=xlValues, Lookat:=xlWhole)
'delete the entire row
findvalue.EntireRow.Delete
End If
'clear the controls
cNum = 9
For X = 1 To cNum
Me.Controls("Emp" & X).Value = ""
Next
'unprotect all sheets for the advanced filter
Unprotect_All
'filter the data
DataSH.Range("B8").CurrentRegion.AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Range("Customers!$L$8:$L$9"), CopyToRange:=Range("Customers!$N$8:$V$8"), _
Unique:=False
'if no data exists then clear the rowsource
If DataSH.Range("N9").Value = "" Then
lstCustomers.RowSource = ""
Else
'add the filtered data to the rowsource
lstCustomers.RowSource = DataSH.Range("outdata").Address(external:=True)
End If
'sort the data by "Surname"
DataSH.Select
With DataSH
.Range("B9:H10000").Sort Key1:=Range("C9"), Order1:=xlAscending, Header:=xlGuess
End With
'Protect all sheets
Protect_All
'return to sheet
Sheet1.Select
'error block
On Error GoTo 0
Exit Sub
ErrHandler:
'Protect all sheets if error occurs
Protect_All
'show error information in a messagebox
MsgBox "An Error has Occurred " & vbCrLf & "The error number is: " & _
Err.Number & vbCrLf & Err.Description & vbCrLf & "Please notify the administrator"
End Sub
Private Sub cmdEdit_Click()
'Edit a customer
'declare the variables
Dim findvalue As Range
Dim cNum As Integer
Dim DataSH As Worksheet
'error handling
On Error GoTo ErrHandler:
'hold in memory and stop screen flicker
Application.ScreenUpdating = False
Set DataSH = Sheet2
'check for values
If Emp1.Value = "" Or Emp2.Value = "" Then
MsgBox "There is not data to edit"
Exit Sub
End If
'clear the listbox
lstCustomers.RowSource = ""
'find the row to edit
Set findvalue = DataSH.Range("B:B"). _
Find(What:=Me.Emp1.Value, LookIn:=xlValues, Lookat:=xlWhole)
'update the values
findvalue = Emp1.Value
findvalue.Offset(0, 1) = Emp2.Value
findvalue.Offset(0, 2) = Emp3.Value
findvalue.Offset(0, 3) = Emp4.Value
findvalue.Offset(0, 4) = Emp6.Value
findvalue.Offset(0, 5) = Emp5.Value
findvalue.Offset(0, 6) = Emp7.Value
findvalue.Offset(0, 7) = Emp8.Value
findvalue.Offset(0, 8) = Emp9.Value
'unprotect the worksheets for the advanced filter
Unprotect_All
'filter the data
DataSH.Range("B8").CurrentRegion.AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Range("Customers!$L$8:$L$9"), CopyToRange:=Range("Customers!$N$8:$V$8"), _
Unique:=False
'if no data exists then clear the rowsource
If DataSH.Range("N9").Value = "" Then
lstCustomers.RowSource = ""
Else
'add the filtered data to the rowsource
lstCustomers.RowSource = DataSH.Range("outdata").Address(external:=True)
End If
'return to sheet
Sheet1.Select
'Protect all sheets
Protect_All
'error block
On Error GoTo 0
Exit Sub
ErrHandler:
'Protect all sheets
Protect_All
'show error information in a messagebox
MsgBox "An Error has Occurred " & vbCrLf & _
"The error number is: " & Err.Number & vbCrLf & _
Err.Description & vbCrLf & "Please notify the administrator"
End Sub
Private Sub lstCustomers_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
'dim the variables
Dim i As Integer
On Error Resume Next
'find the selected list item
i = Me.lstCustomers.ListIndex
'add the values to the text boxes
Me.Emp1.Value = Me.lstCustomers.Column(0, i)
Me.Emp2.Value = Me.lstCustomers.Column(1, i)
Me.Emp3.Value = Me.lstCustomers.Column(2, i)
Me.Emp4.Value = Me.lstCustomers.Column(3, i)
Me.Emp6.Value = Me.lstCustomers.Column(4, i)
Me.Emp5.Value = Me.lstCustomers.Column(5, i)
Me.Emp7.Value = Me.lstCustomers.Column(6, i)
Me.Emp8.Value = Me.lstCustomers.Column(7, i)
Me.Emp9.Value = Me.lstCustomers.Column(8, i)
On Error GoTo 0
End Sub
Private Sub lstCustomers_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
HookListBoxScroll Me, Me.lstCustomers
End Sub
Private Sub UserForm_Initialize()
Me.Emp7 = 0.08
Me.cboHeader = "Name"
Me.txtPSTRate = 0.08
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
UnhookListBoxScroll
End Sub
Display More