Opening a form/text box when checkbox is ticked

klfabre

New member
Local time
Today, 04:09
Joined
Aug 11, 2015
Messages
7
Hi,

I'm a novice user of Access 2013. I've had a look elsewhere but given my severe inexperience with VBA and expressions I'd appreciate some help starting from the beginning... I'm familiar with design view etc. and familiar ish with the property sheet.

I would like to be able to use a checkbox control to make either text boxes or forms appear when ticked, ultimately to stop a form being so untidy/to conserve space. I'd be using this on multiple occasions.

(If actioned, would it automatically shift the other controls in the form down to make space, or would it just overlap? Just a yes/no answer would be great, I can start a new thread about this.)

Any help/advice much appreciated - can provide further info if necessary.
 
Yes, tab control would be a good choice.
To answer your question, making controls visible will not automatically shift other controls around, they will overlap. You would have to programmatically move fields around.
 
Thank you. With regards to the first part of my question, is it possible to make a field or form appear if a checkbox is ticked, e.g. via a macro?
 
You can with VBA, don't know about macro.
You'd put the code in the on click event for the checkbox, something like
if [checkbox] then
[hiddenfield].visible=true
else
[hiddenfield].visible=false
endif

or you could gray out the field by using .enabled instead of .visible
 
don't need to fix something which is working but i thought of a shorter method
[hiddenfield].visible=[checkbox]
to replace the entire if statement
assuming the checkbox only has two states (true/false)
 

Users who are viewing this thread

Back
Top Bottom