Access Queries based on data entered in a form! (1 Viewer)

min3010

Registered User.
Local time
Today, 09:50
Joined
Oct 14, 2007
Messages
10
Hi,

Please help. I have an access form which allows the user to enter some information (time period and date) into textboxes. What is entered by the user is then fed into a query to produce a view when the user clicks on a run query button on the form.

However, I would like to allow the user to save the query with its returned data as if the field conditions were hard coded rather then dynamic. This currently is not working as the results dynamically update based on what is in the forms text boxes.

Once the query is saved I would like for the user to be able to create further views with different periods and dates that are entered into the text boxes, as required and save these too without the previous views being overwritten.

Thanks in Advance!
 

zanaeira

Registered User.
Local time
Today, 09:50
Joined
Aug 8, 2008
Messages
18
Hey, I've never actually done this myself so I haven't got any examples to share with you, but I'm pretty sure you can do this by using a "Make-Table Query". This means that the recordset is saved as a table so that you can view/edit/delete those specific records.

Hope this helps. :)
 
Local time
Today, 03:50
Joined
Mar 4, 2008
Messages
3,856
Sounds like it could be done with some pretty heavy duty programming on your part. When you're done, you might even be able to sell it.

There are some programs that do that (SAP, PeopleSoft, etc.). They had a very large programming budget to make those tools. How big is your budget for this?
 

WayneRyan

AWF VIP
Local time
Today, 09:50
Joined
Nov 19, 2002
Messages
7,122
Min,

What George says is right.

In the most simple sense, you can make a "query" form. When the user
decides, you can make a query out of it. You can save the query under
some name.

But now, you have to complicate that by having the user select a prior
query, modify it and save it under a new name.

On the surface, that isn't too bad, but when they select an existing
query, are you going to populate your "unbound" search form with the
values?

Or are you going to "bind" your form to some "query table".

It starts getting very complex rapidly.

What are you really trying to accomplish?
How big is your budget?

Wayne
 

CyberLynx

Stuck On My Opinions
Local time
Today, 01:50
Joined
Jan 31, 2008
Messages
585
Sometimes, especially in the case of logging scientific data and the equational expressions used to derive the outcome, it is convenient to save the queries used to produce the desired output. Saving these queries as Database Query Objects is obviously not the way to go but saving the query string itself within a Table Field is.

Since you already have a Form and are utilizing data entered into two specific Form Controls (Text Boxes) and it seems obvious that you already have a specific algorithm in play to provide the desired output from the provided Data, your queries should be dynamically created. Since this is the case, there is no reason as to why you can't save the dynamically created query string into a specific Table.

Saving the output from a Query is not necessary since the Statements, Arguments, Expressions, and Data that make up that query string is stored unless of course the data passed within the expression(s) of that Query is cyclical and never stored in perhaps some other Table.

For the most part, a Table consisting of Fields perhaps named QueryString and QueryDescription, should suffice but this is not to say that other desirable Table Fields can not be added. It's all a matter of preference. This Table would of course work hand in hand with a specific Form or Forms which would display all possible results regardless of which saved Query String was put back into play.

If the Query used to display the initial results was in fact dynamically generated (a Query String) then a simple INSERT INTO action query underlying the OnClick event of a "Save Query" Command button can save that Query String to a Table so that it can be pulled up and used again based on the Description provided for that Query String.

.
 

Users who are viewing this thread

Top Bottom