Help Please : Checkboxes Access 2002

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

I have a form with two check boxes PPL & DLP both
controls are in tblReviewH1
on enabling one I want the other to disappear.
I am attempting to use Dlookup to validate the state of
the checkbox which in part works
but changes the property for nearly all the records.....
The table has a unique reference OrderNo for each record
(txt_Ono)
Is there a way that I could adapt the following code to
refer to the OrderNo
and by that get the right result

Private Sub PPL_AfterUpdate()
If DLookup("PPL = True", "tblReviewH1") Then
Me!DLP.Visible = False
Else: If DLookup("PPL = False", "tblReviewH1") Then Me!
DLP.Visible = True
End If

End Sub

Or as usual have I gone in the wrong direction

Would be very grateful if any assistance

Mike
 
Not sure why you need a lookup. If both the fields are shown on your form,
just insert code in the OnExit or AfterUpdate property of the first
checkbox. If I understand, you want CheckBox2 to be hidden if Checkbox1 is
True.

Private Sub checkBox1_AfterUpdate()
If CheckBox1 then
Checkbox2.visible = False
Else Checkbox2.Visible = True
End Sub

As you move from one record to the next, you would want to perform a similar
check...

Private Sub Form_Current()

If CheckBox1 then
Checkbox2.visible = False
Else Checkbox2.Visible = True
End Sub



Rick B




I have a form with two check boxes PPL & DLP both
controls are in tblReviewH1
on enabling one I want the other to disappear.
I am attempting to use Dlookup to validate the state of
the checkbox which in part works
but changes the property for nearly all the records.....
The table has a unique reference OrderNo for each record
(txt_Ono)
Is there a way that I could adapt the following code to
refer to the OrderNo
and by that get the right result

Private Sub PPL_AfterUpdate()
If DLookup("PPL = True", "tblReviewH1") Then
Me!DLP.Visible = False
Else: If DLookup("PPL = False", "tblReviewH1") Then Me!
DLP.Visible = True
End If

End Sub

Or as usual have I gone in the wrong direction

Would be very grateful if any assistance

Mike
 
One more thought. Is this simply an option group? Where the user can check
either PPL or DLP? Sounds kinda like it. Checking PPl will uncheck DLP and
checking DLP will uncheck PPL?

Rick B


I have a form with two check boxes PPL & DLP both
controls are in tblReviewH1
on enabling one I want the other to disappear.
I am attempting to use Dlookup to validate the state of
the checkbox which in part works
but changes the property for nearly all the records.....
The table has a unique reference OrderNo for each record
(txt_Ono)
Is there a way that I could adapt the following code to
refer to the OrderNo
and by that get the right result

Private Sub PPL_AfterUpdate()
If DLookup("PPL = True", "tblReviewH1") Then
Me!DLP.Visible = False
Else: If DLookup("PPL = False", "tblReviewH1") Then Me!
DLP.Visible = True
End If

End Sub

Or as usual have I gone in the wrong direction

Would be very grateful if any assistance

Mike
 
Thanks Rick

I'll get the hang of this someday.

I followed the help instructions for creating an option
group with my two check boxes..as I understand it just by
adding these check boxes to the group it should force
one box to clear if the other is checked. If I have
a conditionally formatted text box and a button in between
the check boxes but not added to the group would this
prevent the uncheck action from being applied ?

Thank you for the quick response and your help


Mike
 
No, as long as they are added as option boxes, it does not matter how far
apart, or what is in between. I have not used option buttons much, and
don't know if they can be bound to a field in a table. If not, then you may
have to use code similar to my first post.



Rick B


Thanks Rick

I'll get the hang of this someday.

I followed the help instructions for creating an option
group with my two check boxes..as I understand it just by
adding these check boxes to the group it should force
one box to clear if the other is checked. If I have
a conditionally formatted text box and a button in between
the check boxes but not added to the group would this
prevent the uncheck action from being applied ?

Thank you for the quick response and your help


Mike
 
Thanks again for your help

Mike

-----Original Message-----
No, as long as they are added as option boxes, it does not matter how far
apart, or what is in between. I have not used option buttons much, and
don't know if they can be bound to a field in a table. If not, then you may
have to use code similar to my first post.



Rick B


Thanks Rick

I'll get the hang of this someday.

I followed the help instructions for creating an option
group with my two check boxes..as I understand it just by
adding these check boxes to the group it should force
one box to clear if the other is checked. If I have
a conditionally formatted text box and a button in between
the check boxes but not added to the group would this
prevent the uncheck action from being applied ?

Thank you for the quick response and your help


Mike






.
 
They can be bound to a field, but they only return back
numbers in the Value property of each option. If that
works for you, than you can bind it...Otherwise, see
Rick's code.


Chris Nebinger
 
Back
Top