Changing a Subreport's Recordsource via a Form

B

BruceF

I have a form that calls up a report. The form has a checkbox and if checked,
changes the recordsource to QueryA. If unchecked, it changes the recordsource
to QueryB.

When I try to run the report, I get a run-time error of 2465 and the message
says "Microsoft Office Access can't find the field 'chkBoxField' referred to
in your expression".

Below is my code:
If Forms![frmMainMenu]![chkBoxField] = True Then
Me.RecordSource = "QueryB"
Else
Me.RecordSource = "QueryA"
End If
Any ideas??
 
K

Klatuu

I cannot find the control with that name on the form. Check to be sure you
spelled it corrrectly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top