[AccessD] Query Criteria problem

Doug Murphy dw-murphy at cox.net
Tue Aug 21 19:23:36 CDT 2007


Thanks Susan,

For now I am going with Arthurs approach since it works and I need to get
this done by tomorrow.  It bothers me though that what should work isn't.  I
should be able to use a standard approach to developing forms and queries
and have the same result all the time.

When I get time I'll play with the queries some more.  There has to be a
reason why I get the errors.

Doug

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

Well, one last and totally off the wall, isn't a chance in he*l suggestion,
try this:

Delete the form reference in the query; compile and compact.

Open the query and type in the reference yourself. 

If you get the same area, type in another reference -- open a completely
different form and type in a reference to that form -- it will fail, but if
the query isn't corrupted, you'll get a different error. At least you know
whether something's corrupted.

One final trick -- if you determine that its corruption and not the
reference, open it in Excel. Be sure NOT to save anything, just use Excel to
open it and then exit right away. I've seen this work, but only a few times
and I can't give you any explanation as to how or why it worked.  

Good luck. 

Susan H. 

Hi Susan,

The query just uses the value in one field on the form as its criteria.  I
tried rebuilding it and importing all the objects into a new database, but
still get the same error message. 

To answer your question it appears, based on the error message that Jet
can't resolve the form object, text box in this case, to get its value.  The
interesting thing is that what ever vba uses to get the value works in the
Immediate window.

Very frustrating.  

Doug 

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

That doesn't really help him tonight Arthur! ;) 

Doug, I can't remember -- does the query run on its own and the form screws
it up? Which object is really causing the problem - the query or the form? I
had this happen with a form/subform once -- it was corrupted and I had to
rebuild it from scratch. 

I hope you find a simpler solution. 

Susan H. 

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.


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

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.484 / Virus Database: 269.12.1/963 - Release Date: 8/20/2007
5:44 PM
 

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