From: deb on 7 Apr 2010 13:18 Access 2003 On my subform I have 3 checkboxes format Yes\No BBAll - control source BBAll default Yes BB1 - control source BB1 default No BB2 - control source BB2 default No and 2 textboxes TextBB1 - control source =DLookUp("[BB1]","[t000Facts]","[UnitID] =" & [UnitNo]) TextBB2 - control source =DLookUp("[BB2]","[t000Facts]","[UnitID] =" & [UnitNo]) If TextBB1 is null then BB1.enabled=false If TextBB2 is null then BB2.enabled=false this means if TextBB1 is empty then the BB1 checkbox selection is disabled(same for BB2). cannot have BBAll=yes if BB1 or BB2= yes and cannot have BB1 or Bb2 =yes if BBAll is checked so here is what I need If user wants to change from BBAll to BB1 or BB2 or BB1 and BB2, then have BBAll auto uncheck. If user wants to change from BB1 or BB2 or both to BBAll then BB1 and BB2 will auto uncheck. Should not have BBAll checked if any other checkbox is checked, and if any other checkbox is check then BbAll should be unchecked. Oh my... I'm so stuck!! -- deb
From: Daryl S on 7 Apr 2010 14:49 If TextBB1 is null then BB1.enabled=false else BB1.enabled=true If TextBB2 is null then BB2.enabled=false else BB2.enabled=true Then, based on what the user clicks, add these code entries: on the BB1_Click event: If Me.BB1 Then BBAll = False Else BBAll = True If Me.BB2 Then BBAll = False on the BB2_Click event: If Me.BB2 Then BBAll = False Else BBAll = True If Me.BB1 Then BBAll = False on the BBAll_Click event: If Me.BBAll Then Me.BB1 = False Me.BB2 = False Else If Me.BB1.enabled OR Me.BB2.enabled Then If (Not Me.BB2) AND (Not Me.BB1) Then msgbox "Be sure to select BB1 or BB2" Else Me.BBAll = True Msgbox "BBAll must be checked because BB1 and BB2 are not able to be checked." End If End If This is untested, and the control names may be different from yours, so work with it and let us know. -- Daryl S "deb" wrote: > Access 2003 > > On my subform I have 3 checkboxes format Yes\No > BBAll - control source BBAll default Yes > BB1 - control source BB1 default No > BB2 - control source BB2 default No > and 2 textboxes > TextBB1 - control source =DLookUp("[BB1]","[t000Facts]","[UnitID] =" & > [UnitNo]) > TextBB2 - control source =DLookUp("[BB2]","[t000Facts]","[UnitID] =" & > [UnitNo]) > > If TextBB1 is null then BB1.enabled=false > If TextBB2 is null then BB2.enabled=false > this means if TextBB1 is empty then the BB1 checkbox selection is > disabled(same for BB2). > > cannot have BBAll=yes if BB1 or BB2= yes > and cannot have BB1 or Bb2 =yes if BBAll is checked > > so here is what I need > If user wants to change from BBAll to BB1 or BB2 or BB1 and BB2, then have > BBAll auto uncheck. > If user wants to change from BB1 or BB2 or both to BBAll then BB1 and BB2 > will auto uncheck. > Should not have BBAll checked if any other checkbox is checked, and if any > other checkbox is check then BbAll should be unchecked. > Oh my... > I'm so stuck!! > -- > deb
|
Pages: 1 Prev: Problem exporting data to Excel using Access VBA Next: Restore database from backup |