Doug Murphy
dw-murphy at cox.net
Tue Aug 21 21:31:01 CDT 2007
Hi Dan, I have tried all the usuall stuff, import all objects into new db; compact/repair; decompile, compact/repair. All with the same result. I have hand typed the string in to pull the criteria off the form and used the builder. Both methodes gave the same result. The interesting thing is that if I check the dependencies for the form the two queries that are giving me problems show up as using the form for criteria. If I open the form and then use the criteria string from the problem query in the VBA IDE immediate window the correct value is returned so the string must be correct. Tried EatBloat too but couldn't get it to import into the new db. I am sure it is operator ignorance. I haven't used it before. In the name of expedience I used Arthur's static function approach to get on with the project. I'd still like to figure out why the original query won't work to give me some peace of mind that I understand what is going on. Thanks for your thoughts. Doug -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Tuesday, August 21, 2007 7:14 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Query Criteria problem Doug, When you have time, try importing all the pieces you need to open this query into a new empty database. Then see if it works. Try a Compact/Repair after your initial attempt to run the query. If one of your pieces won't import, then that's the guilty one! BOL! Dan -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Tuesday, August 21, 2007 7:24 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Query Criteria problem 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 -- 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