Show fields on one record not on others?

  • Thread starter Thread starter Richard Stricker
  • Start date Start date
R

Richard Stricker

Hi, I'm trying to keep my form uncluttered by only showing appropriate
fields when needed.

Some "sales" are in California and then I want to display a field "CA tax".
I can make that field visible or not by using a checkbox....

But when I go to the next record, the CA_tax field (and label) are visible
even though the checkbox (of that record) is not checked.

Any help with this concept would be very appreciated.

Richard Stricker

'the checkbox
If Me!Calif_tax.Value = True Then
'show CA tax only when calif tax is true..
Me!Label24.Visible = True
Me!CA_tax.Visible = True
Else
'hide CA tax
Me!Label24.Visible = False
Me!CA_tax.Visible = False
End If
 
Richard said:
Hi, I'm trying to keep my form uncluttered by only showing appropriate
fields when needed.

Some "sales" are in California and then I want to display a field "CA tax".
I can make that field visible or not by using a checkbox....

But when I go to the next record, the CA_tax field (and label) are visible
even though the checkbox (of that record) is not checked.

Any help with this concept would be very appreciated.

Richard Stricker

'the checkbox
If Me!Calif_tax.Value = True Then
'show CA tax only when calif tax is true..
Me!Label24.Visible = True
Me!CA_tax.Visible = True
Else
'hide CA tax
Me!Label24.Visible = False
Me!CA_tax.Visible = False
End If


Use the form's Current event:

Me!CA_tax.Visible = (Me!Calif_tax)

That assumes that the label is attached to the CA_tax text
box.

You probably want to do the same thing in the check box's
AfterUpdate event.
 
Thanks for your help on this Marshall, I must be missing some other piece of
the puzzle because this idea didn't work in my case.

I put this line in the form Current event..

Me!CA_tax.Visible = (Me!Calif_tax)

Does this translate out to mean,
"if this forms Calif_tax checkbox is true, then this forms CA_tax textbox is
visible."

I included the line in the checkbox afterupdate event, as well, but still no
luck.

I know I am just missing some simple concept here. Your help is needed and
appreciated.

Thanks,

Richard
 
Hi, I am running the debug on this form. When use the standard navigation
buttons that come with the form to change to another record of the form, the
Form Current event does not fire.

Even when i add another (new) record the Current event does not fire. So the
code in that event is not picked up.

How do i pick up the movement between records?
 
Richard said:
Thanks for your help on this Marshall, I must be missing some other piece of
the puzzle because this idea didn't work in my case.

I put this line in the form Current event..

Me!CA_tax.Visible = (Me!Calif_tax)

Does this translate out to mean,
"if this forms Calif_tax checkbox is true, then this forms CA_tax textbox is
visible."

That is correct.
I included the line in the checkbox afterupdate event, as well, but still no
luck.

See your other post about the event not executing.
 
Richard said:
Hi, I am running the debug on this form. When use the standard navigation
buttons that come with the form to change to another record of the form, the
Form Current event does not fire.

Even when i add another (new) record the Current event does not fire. So the
code in that event is not picked up.

How do i pick up the movement between records?


The form's Current event is triggered whenever any kind of
navigation moves to a different record. Double check the
form's OnCurrent property to make sure it contains
[Event Procedure]
 
Back
Top