Instead of If , then, you can write
Forms![Form Name1]![FieldName].ColumnHidden = (Forms![FormName]![Check Box
FieldName] = True)
Forms![Form Name2]![FieldName].ColumnHidden = (Forms![FormName]![Check Box
FieldName] = True)
I can't see the code you are using currently, bu you can use the above example
Or, you can change the name of the fields, to contain a name + running
number, and then you can run the code
For I = 1 To 35
Me("fieldName" & I).ColumnHidden = (Me.[CheckBoxName] = True)
Next I
i hope the example are clear
--
The next line is only relevant to Microsoft''s web-based interface users.
If I answered your question, please mark it as an answer. It''s useful to
know that my answer was helpful
HTH, good luck
VB said:
in this case I have to write 35 'if else' statements. othervice unchecked
checkbox's value is null and I get error. there has to be easier way!!!
Ofer said:
You can set the fields ColumnHidden on the load event of the form.
--
The next line is only relevant to Microsoft''s web-based interface users.
If I answered your question, please mark it as an answer. It''s useful to
know that my answer was helpful
HTH, good luck
:
if another form is closed I get err Msg. if it's closed, columnes are not
hiding!
:
To hide a field in another form
Forms![Form Name]![FieldName].ColumnHidden = True
In a SubForm
Forms![Form Name]![Sub Form NAme].Form![FieldName].ColumnHidden = True
--
The next line is only relevant to Microsoft''s web-based interface users.
If I answered your question, please mark it as an answer. It''s useful to
know that my answer was helpful
HTH, good luck
:
O. and one more thing. it's not Me. it's another form! there is one form with
checkboxes and another one (maybe subform) with textboxes (or datasheet).
:
In the AfterUpdate of each of the 35 checkboxes, you'd need code like:
Me.MyTextbox.Visible = Me.MyCheckbox
to have MyTextbox be visible if MyCheckbox is checked (and not visible if
MyCheckbox is unchecked)
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
I have a query with 35 fields. on the form I'd like to create 35
checkboxes.
user may check or uncheck them depending on he fields thay want to see. is
it
possible? how to pass checkboxes true/fals to query? or how to hide
unnecessary columnes on the form (datasheet)?
help please