Make fields dependent on option of another

  • Thread starter Thread starter PsyberFox
  • Start date Start date
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!
 
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
 
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!
 
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.
 
Back
Top