I am trying to make my payment form have the ability to hide certain fields if a cheque or cash is selected as a method of payment. The code i have created doesn't hide the credit card fields when it is not selected in the payment method field.
any ideas?
Private Sub payment_method_AfterUpdate()
If [payment method] = "credit card" Then
'Enable controls for entering credit card info.
creditcard.Enabled = True
nameoncard.Enabled = True
creditcardnumber.Enabled = True
monthexpirydate.Enabled = True
yearexpirydate.Enabled = True
'Move the cursor to the creditcard Type control.
creditcardType.SetFocus
Else
'Move the cursor to the TotalAmountDue control.
TotalAmountDue.SetFocus
'Disable controls for entering credit card info.
paymenttype.Enabled = False
nameoncard.Enabled = False
creditcardnumber.Enabled = False
monthexpirydate.Enabled = False
yearexpirydate.Enabled = False
End If
End Sub
any ideas?
Private Sub payment_method_AfterUpdate()
If [payment method] = "credit card" Then
'Enable controls for entering credit card info.
creditcard.Enabled = True
nameoncard.Enabled = True
creditcardnumber.Enabled = True
monthexpirydate.Enabled = True
yearexpirydate.Enabled = True
'Move the cursor to the creditcard Type control.
creditcardType.SetFocus
Else
'Move the cursor to the TotalAmountDue control.
TotalAmountDue.SetFocus
'Disable controls for entering credit card info.
paymenttype.Enabled = False
nameoncard.Enabled = False
creditcardnumber.Enabled = False
monthexpirydate.Enabled = False
yearexpirydate.Enabled = False
End If
End Sub