By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,968 Members | 1,642 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,968 IT Pros & Developers. It's quick & easy.

SQL Disappearing From Query

P: 33
This is really odd.

I have the following simple query, MetricsExcellentSellers, which is run against a table called [Selling Flavors]:

SELECT [Selling Flavors].GroupCode, [Selling Flavors].Customer, [Selling Flavors].TotalSales, [Selling Flavors].SalesClass
FROM [Selling Flavors]
WHERE ((([Selling Flavors].SalesClass)="Excellent Seller"));

When a button is clicked, this query is run and the results are diplayed in a subform with the following Source Object: Query.MetricsExcellentSellers

The query works just fine for a short while. The problem is that if I shut down the entire application, whenever I reopen the application, clicking the button tries to run the query but there is no SQL in the query anymore. It just disappears at random times. The query is not updated via a form. Its just a hard coded query that never changes.

I have no idea what could cause this. I am using WinXP SP2 for whatever that is worth with Access 2002.

Thanks for any insight.
Nov 18 '08 #1
Share this Question
Share on Google+
3 Replies

Expert 100+
P: 1,923
your use of a period in object names such as Query.MetricsExcellentSellers might be the cause. Periods are reserved for use to delineate objects. In addition, your use of spaces in object names (although permissable) does not following standard naming conventions (sse the link below):
Nov 19 '08 #2

P: 33
Thanks for the reply.

I will give the object naming suggestion a try (I probably should redo all my objects names anyway for this reason) and post an answer once complete if the changes actually help.
Nov 20 '08 #3

P: 33
Well, I cleaned up the column names (removed white space in the names) in the table that the data is being pulled from for this particular query. The SQL appears to be 'stable' in terms of vanishing at various times.

Thanks for the tips puppydogbuddy.
Nov 30 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.