I have these codes which work fine for copying customer info to database, but i need it copy only customer name to database nothing else.
VBA Code:
Private Sub SaveBtn_Click()
Dim CustomerFld As Control
Dim CustRow As Long, CustCol As Long
If Me.Field1.Value = Empty Then
MsgBox "Please make sure to save a Customer Name before saving", vbCritical
Exit Sub
End If
With Customers
If Invoice.Range("B1").Value = Empty Then 'New Customer
CustRow = .Range("A99999").End(xlUp).Row + 1 'First avail Row
Else
CustRow = Invoice.Range("B3").Value
End If
For CustCol = 2 To 8
Set CustomerFld = Me.Controls("Field" & CustCol - 1)
.Cells(CustRow, CustCol).Value = CustomerFld.Value
Next CustCol
AddCustForm.Hide
Invoice.Range("B1").Value = Field1.Value 'Set Customer Name
End With
End Sub