Private Sub chkUKmainland_Change()
If chkUKmainland = True Then
chkBulk.Enabled = True
Else
chkBulk.Enabled = False
chkBulk = False
End If
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdClearForm_Click()
Call UserForm_Initialize
End Sub
Private Sub cmdOK_Click()
ActiveWorkbook.Sheets("Customer Details").Activate
Range("A4").Select
Dim i As Long
Dim rng As Range
With Worksheets("Customer Details")
Set rng = .Range(.Range("B5"), .Cells(Rows.Count, 1).End(xlUp))
End With
For i = 1 To rng.Rows.Count
Next i
'' now loop thru each time OK is clicked will go to next empty row''
rng(i, 1).Value = cboTitle.Value
rng(i, 2).Value = txtFirstname.Value
rng(i, 3).Value = txtSurname.Value
rng(i, 4).Value = txtAddress.Value
rng(i, 5).Value = txtPostcode.Value
rng(i, 6).Value = txtCity.Value
rng(i, 7).Value = txtCountry.Value
rng(i, 8).Value = cboType.Value
rng(i, 9).Value = txtCardnumber.Value
rng(i, 10).Value = cboexpmonth.Value
rng(i, 11).Value = cboexpyear.Value
rng(i, 12).Value = txtCardholder.Value
rng(i, 13).Value = txtIssue.Value
If chkUKmainland = True Then
rng(i, 14).Value = "Yes"
Else
rng(i, 14).Value = "No"
End If
If chkBulk = True Then
rng(i, 15).Value = "Yes"
Else
rng(i, 15).Value = "No"
End If
End Sub
Private Sub SpinButton1_Change()
txtQuantity.Text = SpinButton1.Value
End Sub
Private Sub txtQuantity_Change()
NewVal = Val(txtQuantity.Text)
If NewVal >= SpinButton1.Min And _
NewVal <= SpinButton1.Max Then _
SpinButton1.Value = NewVal
End Sub
Private Sub UserForm_Initialize()
With cboTitle
.AddItem "Mr"
.AddItem "Miss"
.AddItem "Mrs"
.AddItem "Master"
.AddItem "Dr"
End With
cboTitle.Value = ""
txtFirstname.Value = ""
txtSurname.Value = ""
txtAddress.Value = ""
txtPostcode.Value = ""
txtCity.Value = ""
txtCountry.Value = ""
With cboType
.AddItem "Visa/Delta/Electron"
.AddItem "MasterCard/EuroCard"
.AddItem "American Express"
.AddItem "Switch/Solo"
End With
cboType.Value = ""
With cboexpmonth
.AddItem "01"
.AddItem "02"
.AddItem "04"
.AddItem "06"
.AddItem "07"
.AddItem "08"
.AddItem "09"
.AddItem "10"
.AddItem "11"
.AddItem "12"
End With
cboexpmonth.Value = ""
cboexpyear.Value = ""
With cboexpyear
.AddItem "2004"
.AddItem "2005"
.AddItem "2006"
.AddItem "2007"
.AddItem "2008"
.AddItem "2009"
End With
cboexpmonth.Value = ""
chkUKmainland = False
chkBulk = False
cboTitle.SetFocus
End Sub