[AccessD] Query Criteria problem

Doug Murphy dw-murphy at cox.net
Tue Aug 21 16:46:16 CDT 2007


Hi Arthur,

I use static functions where they make sense but in this case I should be,
and have always been, able to just refer to the value of a control on an
open form.  If I use the static function I still have to set it when the
form is updated to hold the value that is already on the form.  I was
looking for a reason why am am getting this error.  I like to understand why
things happen. 

If I can't figure this out I may go with your suggestion just to get this
done, but I won't feel comfortable that the original problem is still
lurking.

Doug

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller
Sent: Tuesday, August 21, 2007 2:32 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Query Criteria problem

JC and I are on about this from time to time. My preferred approach is
static functions, JC's is a class. Either way, free yourself from dependency
on the form. Search the archive for "static functions" or "classes" and
learn how to break free of dependence upon forms.

A.

On 8/21/07, Doug Murphy <dw-murphy at cox.net> wrote:
>
> Folks,
>
> I have a query that uses the value of a text box on a form as the 
> criteria for one of its fields.  This has been working fine.  I made 
> some updates to the form used in the criteria and then updated the 
> query criteria do to a change of a control name.  Now I get an error 
> when I try and run the query.
> The error message is "The Microsoft Jet database engine does not 
> recognize '[Forms]![frmViewExistingOrder]![txtPumpSelect]' as a valid 
> field name or expression.".  Any idea on what is going on here.  The 
> query runs without the criteria.  The criterial were constructed using 
> the builder so the object spelling is correct.  I have rebuilt the 
> criteria string several times to make sure there isn't a spelling 
> problem.  Have also tested the criteria string in the Immediate window 
> of the VBA IDE and it returns the correct value.
>
> I am at a loss.  I do this all the time but for some reason this one 
> isn't working.
>
> I have tried compact/repair and decompile, recompile, compact and it 
> still errors.  Tried to use EatBloat but couldn't get the new database 
> to import the files.  I must be missing something on the import, it 
> says it imported.
> Not my day.
>
> Thanks for any assistance.
>
> Doug
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list