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 / Forms Programming / January 2005

Tip: Looking for answers? Try searching our database.

Enabled combo boxes w/in subform

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ryan W - 18 Jan 2005 15:59 GMT
I have a check box and two combo boxes within a subform. I would like to
disable my combo boxes until the check box is checked. I have been able to do
this with my subform, but when I add a new record to my main form the cbo
boxes stay enabled. What would the code look like to disable the cbo boxes on
form load and would I need to put code any where else?

Thank you for your time
Signature

Ryan W

Wayne Morgan - 19 Jan 2005 01:57 GMT
You would need code in the AfterUpdate or Click event of the check box and
in the subform's Current event to check the value when you move from record
to record. Without the code in the Current event, the combo boxes will
remain at their last state until you click the check box. You will need to
code for the check box being checked or unchecked.

Example code for each location:
Me.cmbCombo1.Enabled = Me.chkCheckbox
Me.cmbCombo2.Enabled = Me.chkCheckbox

Since the check box's value is True or False, this will simply pass the
value of the check box to the Enabled property of the combo boxes. If the
check box is checked (True) then the combo boxes will be enabled. If the
check box is unchecked (False) then they will be disabled. Set the Triple
State property of the check box to No and set the Default Value property of
the check box to False.

The above could be accomplished using and If..Then..Else statement also, but
this is shorter.

Signature

Wayne Morgan
MS Access MVP

>I have a check box and two combo boxes within a subform. I would like to
> disable my combo boxes until the check box is checked. I have been able to
[quoted text clipped - 3 lines]
> on
> form load and would I need to put code any where else?
 
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.