Coding Access - Making Fields Visible (or Not)

estrassman

New member
Local time
Today, 08:47
Joined
Feb 14, 2012
Messages
1
So I am an newbie and thanks to all who help us. I have an app, Access 2010, that I am writing that has three fields: payment_type, creditcard_name, and creditcard_number.

The payment_type field draws values from a lookup table - and there are three choices: Net 30, Lease and CreditCard

On the form in question what I would like is to have the fields that show credit card name and creditcard number be visible when the payment type is equals to CreditCard but if the payment type equals Net 30 or Lease then the creditcard_name and creditcard_number would not be visible.

I should tell you that I have tried with a complete lack of success in placing code like this in a variety of the event sections but I cannot get it to work:

me.pur_CardName.Visible = False
me.pur_CardNumber.Visible = False
If Me.pur_PaymentType = "CreditCard" Then
Me.pur_CardName.Visible = True
Me.pur_CardNumber.Visible = True
End If

I have tried the OnCurrent, Dirty, On Selection Change thinking that I simply am not putting the code in the write area to have the desired affect. Thanks in advance for any help you can provide.
 
Howzit

In the after update event of your combo box put something like

Code:
Select Case me.yourcombobox
Case 'Credit Card"
  Me.pur_CardName.Visible = True
  Me.pur_CardNumber.Visible = True
Case else
  Me.pur_CardName.Visible = false
  Me.pur_CardNumber.Visible = false
End Select
 

Users who are viewing this thread

Back
Top Bottom