Simple Checkbox Query

JM79

New member
Local time
Today, 02:01
Joined
Jul 11, 2006
Messages
7
I have a checkbox in my subform.

if I check it true I want it to copy the values of a field in the form to a field in the subform

Why isnt this as easy as

Private Sub copy_caller_Click()

If caller_copy = True Then
subformcaller.Value = formcaller.Value


End If
End Sub


TIA
 
PHP:
Private Sub copy_caller_Click()

If caller_copy = True Then
subformcaller.Value = formcaller.Value


End If
End Sub
should be
PHP:
Private Sub copy_caller_Click()
If forms!MainFormname!caller_copy = True Then
  Me!subformcaller = forms!MainFormname!formcaller
End If
End Sub

Or on the copy_caller_AfterUpdate event
PHP:
Private Sub copy_caller_Afterupdate()
If forms!MainFormname!caller_copy = True Then
  Me!subformcaller = forms!MainFormname!formcaller
End If
End Sub

Remember checkboxes have three values, Null, True and False. Always check against True to avoid interpretation of Null. Null and False checkbox values have different Backcolors.
 

Users who are viewing this thread

Back
Top Bottom