A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Save a query as an SQL Statement into a Table



 
 
Thread Tools Display Modes
  #1  
Old March 28th, 2010, 08:54 PM posted to microsoft.public.access.forms
Bob1
external usenet poster
 
Posts: 2
Default Save a query as an SQL Statement into a Table

I have a couple of different ways of producing mailing lists from
forms in my database. Users don't have access to the database window.
Once the list is created users can save the list by typing a new name
for the list into a text box and the end result is saved as a table
with this name with a Make Table Query. My thinking is that it would
be better for users to be able to save these lists as SQL Statements.
These could be stored into a table as presumably this would use up
less less space and would save having a lot of tables with duplicate
data. Can someone help me with a way of doing this?
Thanks Bob
  #2  
Old March 30th, 2010, 03:03 PM posted to microsoft.public.access.forms
Daryl S[_2_]
external usenet poster
 
Posts: 881
Default Save a query as an SQL Statement into a Table

Bob1 -

You need to decide what you are saving the query or results for. If you
save the data (as you are now with tables), then you will always be able to
see the mailing list that was used at the time the table was created. Is
this information historically significant in that you must keep track of the
results at that time? Will the user be re-using this list, or would they
want to create a new list using the same criteria? If the business need is
to save the criteria rather than the data, then you can save the query
instead of the results. Look up the CreateQueryDef method to do this. If
there is a need for users to only see their own queries, then when you save
them, prepend the name with the user's logon name, and then you can display a
list of just their saved queries for them to choose from.

--
Daryl S


"Bob1" wrote:

I have a couple of different ways of producing mailing lists from
forms in my database. Users don't have access to the database window.
Once the list is created users can save the list by typing a new name
for the list into a text box and the end result is saved as a table
with this name with a Make Table Query. My thinking is that it would
be better for users to be able to save these lists as SQL Statements.
These could be stored into a table as presumably this would use up
less less space and would save having a lot of tables with duplicate
data. Can someone help me with a way of doing this?
Thanks Bob
.

  #3  
Old March 30th, 2010, 11:14 PM posted to microsoft.public.access.forms
Bob1
external usenet poster
 
Posts: 2
Default Save a query as an SQL Statement into a Table

On Mar 30, 3:03*pm, Daryl S wrote:
Bob1 -

You need to decide what you are saving the query or results for. *If you
save the data (as you are now with tables), then you will always be able to
see the mailing list that was used at the time the table was created. *Is
this information historically significant in that you must keep track of the
results at that time? *Will the user be re-using this list, or would they
want to create a new list using the same criteria? *If the business need is
to save the criteria rather than the data, then you can save the query
instead of the results. *Look up the CreateQueryDef method to do this. *If
there is a need for users to only see their own queries, then when you save
them, prepend the name with the user's logon name, and then you can display a
list of just their saved queries for them to choose from.

--
Daryl S



"Bob1" wrote:
I have a couple of different ways of producing mailing lists from
forms in my database. Users don't have access to the database window.
Once the list is created users can save the list by typing a new name
for the list into a text box and the end result is saved as a table
with this name with a Make Table Query. My thinking is that it would
be better for users to be able to save these lists as SQL Statements.
These could be stored into a table as presumably this would use up
less less space and would save having a lot of tables with duplicate
data. Can someone help me with a way of doing this?
Thanks Bob
.


Daryl S Thats really helpful. I hadn't come across CreateQueryDef
before. The important thing is to save the criteria rather than the
history so this will work fine
Thanks very much.
Bob
 




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 Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:56 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.