Using a form control to change another form control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to use a checkbox, that when checked will place a value in a
textbox. I would also like that when it is unchecked to remove the value. I
have tried using an if then structure in the on_click event for the check box
to as yet no successful results. Any ideas???
 
Private Sub Check6_AfterUpdate()

If (Me.Check6) Then
Me.Text12 = "Checked!"
Else
Me.Text12 = "Not Checked!"
End If

End Sub

Where 'Check6' is the name of the check box, and 'Text12' is the name of the
text box.
 
mkellen494 said:
I would like to use a checkbox, that when checked will place a value in a
textbox. I would also like that when it is unchecked to remove the value.


If Me.checkbox = False Then
Me.textbox = Null
Else
Me.textbox = somevalue
End If
 
OK! Now what do i need to do in order to get it to assume the state as I page
from record to record. If I turn it off it stay off as I move through the
different records.
 
I just replied to an earlier post, what do I need to do in order to allow the
check bo x to be consistent as I scroll through records? I f I turn it off it
stays off as I page through records and vice versa.
 
mkellen494 said:
I just replied to an earlier post, what do I need to do in order to allow the
check bo x to be consistent as I scroll through records? I f I turn it off it
stays off as I page through records and vice versa.


Not clear what "turn it off" means. A bound Check box will
display the state of the field in the table's current
record. If the check box is unbound, then it will only
change when you change it.

If you meant that the text box isn't syncing up with the
check box, add the same code to the form's Current event.
 
As Marshall suggests elsewhere in this thread, add the same code to the
Form_Current event procedure.
 
Back
Top