Make fields dependent on option of another

P

PsyberFox

Hi again!

On an input screen (set up as a form), is it possible to only make certain
fields accessible based on another field. e.g. I have a field for department,
and depending and which department is selected other fields must be enabled /
disabled. For the knitting department, a machine number field must be
available but for the assembly department, a clock number field must be
available, and the machine number must be disabled.

Thank you kindly!
 
A

Alex Dybenko

hi,
yes, you can use for example department field AfterUpdate event to set other
fields enabled property:

If me.department="knitting" then
me![machine number].enabled=true
else
me![machine number].enabled=false
end if


you can use also select case if you have several departments

--
Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com
 
P

PsyberFox

Thank you - exactly what I was looking for...

Alex Dybenko said:
hi,
yes, you can use for example department field AfterUpdate event to set other
fields enabled property:

If me.department="knitting" then
me![machine number].enabled=true
else
me![machine number].enabled=false
end if


you can use also select case if you have several departments

--
Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com

PsyberFox said:
Hi again!

On an input screen (set up as a form), is it possible to only make certain
fields accessible based on another field. e.g. I have a field for
department,
and depending and which department is selected other fields must be
enabled /
disabled. For the knitting department, a machine number field must be
available but for the assembly department, a clock number field must be
available, and the machine number must be disabled.

Thank you kindly!
 
S

Stuart McCall

PsyberFox said:
Hi again!

On an input screen (set up as a form), is it possible to only make certain
fields accessible based on another field. e.g. I have a field for
department,
and depending and which department is selected other fields must be
enabled /
disabled. For the knitting department, a machine number field must be
available but for the assembly department, a clock number field must be
available, and the machine number must be disabled.

Thank you kindly!

In the AfterUpdate event of the Department control:

Me.Machine_Number.Enabled = (Me.Department = "knitting")
Me.Clock_Number.Enabled = (Me.Department = "assembly")

The expressions between the parens will return True or False, which is
exactly what you need to feed into the Enabled property. Using that code,
Machine_Number will also be disabled if Department is assembly.
 

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

Top