If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Help Please : Checkboxes Access 2002
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 |
#2
|
|||
|
|||
Help Please : Checkboxes Access 2002
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 "Mike" wrote in message ... 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 |
#3
|
|||
|
|||
Help Please : Checkboxes Access 2002
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 "Mike" wrote in message ... 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 |
#4
|
|||
|
|||
Help Please : Checkboxes Access 2002
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 -----Original Message----- 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 "Mike" wrote in message ... 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 . |
#5
|
|||
|
|||
Help Please : Checkboxes Access 2002
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 "Mike" wrote in message ... 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 -----Original Message----- 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 "Mike" wrote in message ... 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 . |
#6
|
|||
|
|||
Help Please : Checkboxes Access 2002
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 "Mike" wrote in message ... 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 -----Original Message----- 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 "Mike" wrote in message .. . 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 . . |
#7
|
|||
|
|||
Help Please : Checkboxes Access 2002
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 -----Original Message----- 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 "Mike" wrote in message .. . 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 -----Original Message----- 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 "Mike" wrote in message . .. 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 . . . |
Thread Tools | |
Display Modes | |
|
|