Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / November 2005

Tip: Looking for answers? Try searching our database.

Disabling text box in form contingent on criteria

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jack Sheet - 18 Nov 2005 16:50 GMT
Hi all
Access 97

This sounds like a fairly standard sort of thing to do, but I am stuck.

I want a text box in a form (to update a field in a table) to be enabled or
disabled for editing depending on the value of another field within the same
record.

Eg: if ClientType field is "Company" then I want a yes/no box tied to field
"PLC" to be enabled to tick, but if the ClientType field is anything else I
want the PLC checkbox to be disabled and greyed out.

There are two problems.  I expect that should be fairly easy (albeit
currently beyond my capabilities) to have the enabling/disabling updated
when amendments to the record are saved, so that when next opening the
record the field will be enabled or not.  However, ideally (and I suspect
more difficult to achieve) I would like the field to be enabled or disabled
instantanously when the ClientType field is amended.  I can live without
this ideal if I have to.

Thanks for any help.
John Spencer - 18 Nov 2005 20:00 GMT
You don't enable/disable fields. You enable/disable controls.

I would put code in two places.  The form's current event and the ClientType
control's afterupdate event.

If Me.ClientType & vbNullstring = "Company" Then
  Me.PLC.Enabled = True
Else
 Me.PLC.Enabled = False
End If

> Hi all
> Access 97
[quoted text clipped - 18 lines]
>
> Thanks for any help.
Jack Sheet - 19 Nov 2005 00:00 GMT
Thanks John

Signature

Return email address is not as DEEP as it appears

> You don't enable/disable fields. You enable/disable controls.
>
[quoted text clipped - 29 lines]
>>
>> Thanks for any help.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.