My Assistant
![]() ![]() |
|
|
Mar 11 2009, 09:28 AM
Post
#1
|
|
|
New Member Posts: 10 |
On the form I created there are two Combo Boxes (SelMainWONum and SelServWONum), both are set as Disabled.
If the check box (GasMain) gets checked the SelMainWONum becomes enabled and If the check box (GasService) gets checked the SelServWONum becomes enabled. The problem I am having is when I check either box the combo box is enabled for all records even if a box in a a record is not checked. For example: If I check GasService all the combo boxes for SelServWONum become enabled. If I go to a new record that does not have either box checked and click on a field in that record without checking a box then both SelMainWONum and SelServWONum go Disabled. Any help or suggestions would be greatly appreciated Private Sub Form_Current() If Me.GasService = True Then Me.SelServWONum.Enabled = True Me.SelMainWONum.Enabled = False Me.GasMain = False ElseIf Me.GasMain = True Then Me.SelServWONum.Enabled = False Me.SelMainWONum.Enabled = True Me.GasService = False Else Me.SelServWONum.Enabled = False Me.SelMainWONum.Enabled = False End If End Sub Private Sub GasMain_Click() If Me.GasMain = True Then Me.SelServWONum.Enabled = False Me.SelMainWONum.Enabled = True Me.GasService = False Else Me.SelServWONum.Enabled = False Me.SelMainWONum.Enabled = False End If End Sub Private Sub GasService_Click() If Me.GasService = True Then Me.SelServWONum.Enabled = True Me.SelMainWONum.Enabled = False Me.GasMain = False Else Me.SelServWONum.Enabled = False Me.SelMainWONum.Enabled = False End If End Sub
Attached File(s)
|
|
|
|
Mar 11 2009, 11:29 AM
Post
#2
|
|
|
UtterAccess Veteran Posts: 479 |
Your post seems contradictory. You said:
The problem I am having is when I check either box the combo box is enabled for all records even if a box in a a record is not checked. And then you said: For example: If I check GasService all the combo boxes for SelServWONum become enabled. If I go to a new record that does not have either box checked and click on a field in that record without checking a box then both SelMainWONum and SelServWONum go Disabled. Isn't that what's supposed to happen? If no boxes are checked, everything is disabled. If GasService is checked, SelServWONum should be enabled. What do you mean by "all combo boxes for SelServWONum" become enabled, isn't SelServWONum the combo box? Or did you mean both combo boxes (SelServWONum and SelMainWONum) become enabled? |
|
|
|
Mar 11 2009, 08:51 PM
Post
#3
|
|
|
UtterAccess VIP Posts: 1,903 From: UK |
you need to set the same controls in the current event for the form as well - this fires as you move from record to record
|
|
|
|
Mar 12 2009, 05:56 AM
Post
#4
|
|
|
UtterAccess Veteran Posts: 479 |
It looks like he did that...see the first sub, Form_Current.
|
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 23rd May 2013 - 01:46 PM |