Making texboxes invisible depending on the value in them
Thank you for taking the time to report an issue.
What's wrong... Please write below.
In my example, I have two check boxes which I have set up to allow only one choice. So when you check one, the other becomes unchecked!
Behind both these check boxes I have managed to write the code which does make the command button visible/invisible depending on which check box is checked. See bellow
However, the crucial bit I am missing is that it does the same response for ever record. So if I want it invisible in one record that's fine,but then if you go to the next record where you want it to be visible, and have checked the correct box for this to happen, it is still invisible. What I need is some additional coding which ties it to the current record?
I had this behind the on change event of the mainform. Doesn't work though.
So if txt15 is blank then visible = FALSE this should then reveal txt18 which should then have data in.
I have looked through the forum and found something similar to the following.
Private Sub FormHeader_Format(Cancel As Integer, FormatCount As Integer)
Me.Txt15.Visible = Not IsNull(Me.Txt15)
Me.Txt18.Visible = Not IsNull(Me.Txt18)
It works to a degree, but if txt15 is Blank it does not make the textbox invisible thus will not display Txt
If I had say 10 fields all all those 10 fields were to be set to invisible or visible depending on a single check mark box, could I say 'draw' something maybe a special 'frame' around those10 fields so that I can refer to the 'frame' and everything in that area could be invisible or visible based upon the check mark box versus having to code 10 fields individually?
to turn invisible use coding:
Me.Home_Goals.Visible = Nz(Me.Home_Walkover, "") = "Inactive
I'm not sure what I'm doing wrong. I'm pretty new to VBA but am quite good with macros and still can't make it work. I have tried setting my field [via] event as got focus, lost focus and change. I can get it to work if I choose the first choice the relevant field becomes visible but if I choose anything else the relevant fields do not become visible and the first field won't go invisible.
I have a question about conditional formating of fields.
I have a form with 18 fields which must be visible or invisible depending on the value of a combobox "code"
record 1 code A1-3 Visible 1,2,3,4,5,6 hide the rest
record 2 code A1-1 visible 1,2,8,9 hide the rest
recode 3 code A2-10 visible 5,6,7,8,9 hide the rest
sample is enclosed
Can I group them or I have to write code for each of the controls?