coding for payment method

selina24

New member
Local time
Today, 09:18
Joined
Apr 20, 2009
Messages
2
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
 
Use the .visible property of a field to hide it or show it as required.

ie

paymenttype.visible = False
nameoncard.visible = False
creditcardnumber.visible= False

will hide these fields.
 
selina

if you can edit/review old records you will need the same code in the forms current event also
 

Users who are viewing this thread

Back
Top Bottom