SubForm entry triggered by Form chkbox click

  • Thread starter Thread starter Nancy Docken
  • Start date Start date
N

Nancy Docken

Hi,

I have a form with a subform. I want to do two things
automatically when I click on a checkbox on the parent
form.

1. I want the subform to appear. (This is working)
2. I want today's date automatically entered into a field
on the subform. (This is NOT working.)

The default value of the checkbox is set to "false". The
control source of the subform field contains this code
(without the outer quotes, of course):

"=If(Forms!fMainform!Checkbox=True,Date(),"")"

All I'm getting is #Name?. Any suggestions? I've tried
lots of fixes, but no luck so far. Thanks for any help
you can offer.
 
Nancy said:
I have a form with a subform. I want to do two things
automatically when I click on a checkbox on the parent
form.

1. I want the subform to appear. (This is working)
2. I want today's date automatically entered into a field
on the subform. (This is NOT working.)

The default value of the checkbox is set to "false". The
control source of the subform field contains this code
(without the outer quotes, of course):

"=If(Forms!fMainform!Checkbox=True,Date(),"")"

All I'm getting is #Name?.


The name of the function is IIf. If is a VBA statement.

But that might not do what you want. If not, you could use
a little VBA in the check box's AfterUpdate event:

Me.subform.Visible = Me.thecheckbox
If Me.thecheckbox = True
Me.subform.Form.thedatetetbox = Date()
End If
 
Back
Top