Thanks Brian. I am not a technical person and have created this userform with help from the internet. I'm not sure where I should put the code you have given. Am pasting the code from my userform with hopes that you can point me to exactly what I need to do. I created a client id which I think would be equal to your locationnumber.
Private Sub cmdAdd_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Clients")
'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row
'check for a client id
If Trim(Me.txtclientname.Value) = "" Then
Me.txtclientname.SetFocus
MsgBox "Please enter a Client"
Exit Sub
End If
'copy the data to the database
ws.Cells(iRow, 1).Value = Me.ComboBox3.Value
ws.Cells(iRow, 2).Value = Me.ComboBox4.Value
ws.Cells(iRow, 3).Value = Me.ComboBox1.Value
ws.Cells(iRow, 4).Value = Me.ComboBox6.Value
ws.Cells(iRow, 5).Value = Me.ComboBox7.Value
ws.Cells(iRow, 6).Value = Me.ComboBox2.Value
ws.Cells(iRow, 7).Value = Me.ComboBox5.Value
ws.Cells(iRow, 8).Value = Me.txtreason.Value
ws.Cells(iRow, 9).Value = Me.txtclientname.Value
ws.Cells(iRow, 10).Value = Me.txtadd1.Value
ws.Cells(iRow, 11).Value = Me.txtadd2.Value
ws.Cells(iRow, 15).Value = Me.txtphone.Value
ws.Cells(iRow, 16).Value = Me.txtnotes.Value
ws.Cells(iRow, 17).Value = Me.txtclientid.Value
'clear the data
Me.ComboBox3.Value = ""
Me.ComboBox4.Value = ""
Me.ComboBox1.Value = ""
Me.ComboBox6.Value = ""
Me.ComboBox7.Value = ""
Me.ComboBox2.Value = ""
Me.ComboBox5.Value = ""
Me.txtreason.Value = ""
Me.txtclientname.Value = ""
Me.txtadd1.Value = ""
Me.txtadd1.Value = ""
Me.txtphone.Value = ""
Me.txtnotes.Value = ""
Me.txtclientid.Value = ""
Me.txtclientname.SetFocus
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub UserForm_Click()
End Sub
Thanks.