dbTalk Databases Forums  

Opening a report using a form's filter

comp.databases.ms-access comp.databases.ms-access


Discuss Opening a report using a form's filter in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
saintor1@hotmail.com
 
Posts: n/a

Default Opening a report using a form's filter - 12-10-2010 , 11:05 AM






I need some help here.

It might be something diffferent in ACC2007/2010. Unless I am
mistaken, before I used a form's filter to open a report. It worked.

Now I get an error.

As example if my form's filter is 'EmplNo=108' and open my report
using it, it will say that 'forms!EmplNo' is not recognized instead of
referring to simply 'EmplNo'. They have both the same
recordsource. Specifying the filter in the openrecord command (in
form's code rather than at report's opening) does the same error.

Ho do I get around this?

TIA.

Reply With Quote
  #2  
Old   
Stuart McCall
 
Posts: n/a

Default Re: Opening a report using a form's filter - 12-10-2010 , 11:57 AM






<saintor1 (AT) hotmail (DOT) com> wrote

Quote:
I need some help here.

It might be something diffferent in ACC2007/2010. Unless I am
mistaken, before I used a form's filter to open a report. It worked.

Now I get an error.

As example if my form's filter is 'EmplNo=108' and open my report
using it, it will say that 'forms!EmplNo' is not recognized instead of
referring to simply 'EmplNo'. They have both the same
recordsource. Specifying the filter in the openrecord command (in
form's code rather than at report's opening) does the same error.

Ho do I get around this?

TIA.
Looks like you left out the form name. Try:

Forms!FormName!EmplNo

(substituting FormName for the actual name of your form)

Reply With Quote
  #3  
Old   
agiamb
 
Posts: n/a

Default Re: Opening a report using a form's filter - 12-10-2010 , 02:23 PM



Please post your code, the exact error message and the exact filter. Also
explain exactly how the form's filter is created/applied. I have a feeling
about what it is, but need info to be sure.

--

AG
Email: npATadhdataDOTcom


<saintor1 (AT) hotmail (DOT) com> wrote

Quote:
I need some help here.

It might be something diffferent in ACC2007/2010. Unless I am
mistaken, before I used a form's filter to open a report. It worked.

Now I get an error.

As example if my form's filter is 'EmplNo=108' and open my report
using it, it will say that 'forms!EmplNo' is not recognized instead of
referring to simply 'EmplNo'. They have both the same
recordsource. Specifying the filter in the openrecord command (in
form's code rather than at report's opening) does the same error.

Ho do I get around this?

TIA.

Reply With Quote
  #4  
Old   
saintor1@hotmail.com
 
Posts: n/a

Default Re: Opening a report using a form's filter - 12-10-2010 , 02:55 PM



Quote:
it will say that 'forms!EmplNo'
I meant 'frmProd!EmplNo' frmProd is the name of my form.

Sorry

Reply With Quote
  #5  
Old   
saintor1@hotmail.com
 
Posts: n/a

Default Re: Opening a report using a form's filter - 12-14-2010 , 11:38 AM



I found the culprit. In short, the recordsource has to be i-den-ti-
cal.

Referring to a field from "MyProdRecordsource" recordset will not do
the same as referrring to a field from "SELECT * from
MyProdRecordsource WHERE EmplID='108'"

In the first case, the form's filter will use the original recordset
name (MyProdRecordsource.fieldName) and in the second case, it will
use the form name (MyFormName.fieldName).




On Dec 10, 12:05*pm, "saint... (AT) hotmail (DOT) com" <saint... (AT) hotmail (DOT) com>
wrote:
Quote:
I need some help here.

It might be something diffferent in ACC2007/2010. * Unless I am
mistaken, before I used a form's filter to open a report. * It worked.

Now I get an error.

As example if my form's filter is 'EmplNo=108' and open my report
using it, it will say that 'forms!EmplNo' is not recognized instead of
referring to simply 'EmplNo'. * They have both the same
recordsource. * Specifying the filter in the openrecord command (in
form's code rather than at report's opening) does the same error.

Ho do I get around this?

TIA.

Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.