Toggle Visible Property for each Record in a Continuous Subform

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

Guest

A have a continuous subform with two fields in each record:
chkNo, txtCitizenship

I want: The user to be able to show/hide the text box (txtCitizenship) by
checking/unchecking the check box (chkNo). Each record can be different: one
record could have txtCitizenship.Visible=True and another
txtCitizenship.Visible=False. My attempts at changing the Visible property
changed the field for every record .. I want to be able to hide the field in
some records and show the field in others.

Any suggestions?
 
My attempts at changing the Visible property
changed the field for every record

yes, that's the expected behavior, because there is only one control on the
form, not multiple controls. in a Continuous form, what you see is multiple
*instances* of the one control. i think the best you'll be able to do is use
Conditional Formatting, on the Format menu, to Enable/Disable the
txtCitizenship control based on the value of the chkNo control.

hth
 
To expand on Tina's idea, you could set the back color and the fore color to the
same color when the chkno is true (or false). That will effectively turn the
text invisible, although the control will still be visible. In addition you
will need code in the form's current event to set the control's enabled and
locked fields appropriately.
 
Unfortunatly, you can't do that in a continuous form. Although you may have
many records displayed, there is only one instance of a control, so setting a
property for a control affects all records in the recordset.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top