PC Review


Reply
Thread Tools Rate Thread

Changing a Subreport's Recordsource via a Form

 
 
BruceF
Guest
Posts: n/a
 
      17th Dec 2007
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??
 
Reply With Quote
 
 
 
 
Klatuu
Guest
Posts: n/a
 
      17th Dec 2007
I cannot find the control with that name on the form. Check to be sure you
spelled it corrrectly.
--
Dave Hargis, Microsoft Access MVP


"BruceF" wrote:

> 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??

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Report's recordsource = form's recordsource Johnny Bright Microsoft Access Reports 4 27th Nov 2007 11:21 PM
setting RecordSource vs. setting RecordSource and Filter =?Utf-8?B?VCBSYXkgSHVtcGhyZXk=?= Microsoft Access VBA Modules 7 30th Mar 2006 04:03 AM
Problem with Reports recordsource= Forms recordsource Alex Microsoft Access Reports 5 13th Nov 2004 11:50 PM
Repot Recordsource same as Form Recordsource Alex Microsoft Access 1 13th Nov 2004 09:59 AM
Problem with Reports recordsource= Forms recordsource Alex Microsoft Access 0 13th Nov 2004 09:54 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:52 PM.