IF statement in Access

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a master database containing vehicle information, including leins.
However, not every vehicle has a lein on it. How do I skip over entering
this info. I have a field that is either YES/NO to the question "Is there a
lein on the vehicle?"

Thanks,
Les
 
One option you have is to make the form fields for liens visible only if yes
is checked.

That will only work if the data in the fields is not "required" in the
underlying table(s)


Bob
 
Being new to ACCESS, I understand what you are saying, just don't know how to
do it. Can you elaborate?

Thanks,
Les
 
Here's the concept:

1. make the fields for liens not visible by default ( Properties | Format |
Visible = no)

2. When the checkbox is checked (= -1), your code will say this
Me.Fieldname.Visible = true (translation: for the form I am in (Me), go to
the field and make it visible)

The code should probably be attached to the After Update event on the
checkbox (assuming you want the fields to appear when it is checked)

You may also want to attach the code to events relating to the form -
assuming you want the fields to show on existing data where the box is
checked.

(Note: each object on the form has events AND the form itself has
events..you may want to experiment with this to see how they work)

Bob
 
Okay, I understand the concept. However, I am not sure of the coding. This
are the fields I have:

LEIN (Yes/No) --> this is a check box

Then I have a lein section with four different fields pertaining to lein
info, ie LEIN HOLDER, AMOUNT, PAYMENT, LENTH OF LOAN.

I want to bypass the entire lein section if the checkbox is NO.

I understand making the lein section not visible and not required. If I
understand what you said, I should also make all the fields in the lein
section visible AFTER UPDATE of the lein checkbox. I assume this requires a
macro and I am not sure of the coding.

Les
 
Back
Top