Dynamic Queries

Mar 3, 2006

i have a database that imports files with dynamic amounts of fields, runs querys on the data and outputs it to a speadsheet. The The problem is instead of making it run querys on each column, i have it running on them all collectively. Now i want to change it so a query is run on each column then output to its own spreadsheet. Does anyone know how to do this?

View Replies


ADVERTISEMENT

Queries :: Using Dynamic Crosstab Queries In Forms

Jan 21, 2014

I am building a database which tracks tasks assigned to employees. I want to have one of my forms displaying a view which shows at a glance which tasks are assigned to whom at what times of the day, with a click opening a task for editing. My current attempt is to create a crosstab query with the employees as the column headings ("dynamic crosstab" query) and a table of time values for the hours of the day providing the row headings, with the task as the value.

I then created a form based on the query with Datasheet view as the default view (apparently necessary to set properties/event handlers to query values. I got the idea from the Northwind sample database) However, the form fields do not update to reflect changes to the employee list and therefore the onClick handlers are not applied to newly added employees. What to do, besides for programmatically setting the event handlers?

View 2 Replies View Related

Dynamic Excel Queries

May 8, 2006

I've got a database that I need to import a vacation days table from an excel sheet. The biggest deal with it all is that the excel file & range it needs to search for the data is dynamic, actually I also need to be able to scan different sheets within the excel file.

Now, im not new to all this stuff, ive done all sorts of complicated excel manipulation in VBA as well as queries and custom processing, but I've been away from it all for roughly 8 mo. so im rusty.

If anyone has a suggestion about how i could go about loading the excel file (dynamically) and pulling information from it (i will be doing aggrigates like SUM & Count, however i can program these manually if need be.)

Thanks

-ReAn

View 2 Replies View Related

How To Make Dynamic Queries

Jun 19, 2006

I have several fields that have a drop down list. Say the Field is called "Age" and I have choices in the drop down menu as 1, 2, 3, and 4. How do I create a query that would accept input from the user to show 2 of the 4 or 1 of the 4 or all of the choices using one query that has checkboxes, and possibly using a form to do so. I have a form that has a list of all entries. Now I just need to make it able to filter based on user input.

Say I have checkboxes for 1, 2, 3, 4, and all choices. Can a list filter only what I check? Can I create a form that would have all the choices on it and just click a button that says "submit" and have it filter, or print the form. How do you get the checkboxes to filter when checked, but not when unchecked? Where does Access store the true/false, on/off, yes/no responces that come from the checkbox? Is there a variable that gets set to a 1 or a 0 based on the status of the box?

View 1 Replies View Related

Making A Dynamic Report From My Dynamic Form

Jun 30, 2006

I have a form that shows a list of all of my records in my database. I want to be able to click a button called "Report" and have that print a report that has all the records I have filtered on my form. I have a report in the format that i want it in, however, currently it prints every record and not just what is shown on my form. (The form is dynamic and I want the Report to be dynamically based on the form) HELP PLEASE!

View 6 Replies View Related

Queries :: Creating Dynamic Copy Of Database

Jan 20, 2015

I have a relatively small data base.

There are a number of what I call reference tables. These are fairly static and in the main will not change.

There are a further half a dozen tables all linked together.

The system basically takes an enquiry which may lead to a repair taking place. The repair will have a number of jobs and each job may have parts replaced.

What I want to do is have an identical database which to begin with will have exact copies of all the reference tables. The remaining half a dozen tables initially will be empty but grow with time.

The user wants to be able to copy the completed repairs he selects over to the 2nd database (which is initially empty). As weeks go by he wants to select further completed jobs that have not already been copied over to the 2nd database. The 2nd database will be updated so I can't just copy over all completed repairs each time.

I had envisage him doing this by using a front end to the 2 databases and firstly selecting which of the completed jobs which haven't been copied over. This is a fairly straight forward query that will update a field on the repair table.

Once he has done this I was thinking that I could run a query that would pull all the rows from the 6 tables from database 1 and update the corresponding tables/rows on the 2nd database.

I don't actually know how to approach that. The process needs to be simple for the user. ie 1. select repairs to copy over 2. run something to copy them over.

View 11 Replies View Related

Queries :: Dynamic Top Value According To Number Entered By User?

Dec 17, 2013

Is it possible to have the user enter the number of top records to choose in a query?

I know that you can enter a number or percentage in the Top Values property of the query but I would like the user to be able to enter this number each time they run the query since it may be different each time and not always, say, the top 10 records.

View 12 Replies View Related

Queries :: DSum With Dynamic Date Criteria

Jul 10, 2013

I need to do a DSum with criteria that picks up a previous month based on todays date, I have got the following but I don't know how to format the last part of the criteria.

If I take out the Month(DateAdd("m",-13,(Date()))) and replace it with 6 it works fine.

Code:
DSum("[invquan]","[qrySalesByStockCode]","[stcode] = '" & [stockcode] & "' and [Month] = Month(DateAdd("m",-13,(Date())))'")

View 1 Replies View Related

Queries :: Dynamic Query Needs Parameter Two Times

Oct 18, 2013

Sometimes i have a problem with dynamical queries. For some of these i need to put in the same parameter value two times, before it works. Why this occurs?

View 2 Replies View Related

Queries :: Dynamic Query Based On A Form (ComboBox)

Jan 22, 2014

We have a ComboBox on a form with the months: Jan, Feb, Mar, Apr, etc.

We have fields in a budget table named: Jan, Feb, Mar, Apr, etc.

We want to create a query that pulls the correct field based on the value in the combo box.

This is what I have that doesn't work:

MyField: [Query1].[SumOf] & Forms![Main Menu]![test]

How to do this?

View 4 Replies View Related

Queries :: Dynamic Cross Tab Query - Column Sort By Corresponding ID

Apr 23, 2015

I have a dynamic cross tab query - thus the column headings will change each time it is run.

At present the column headings are displayed in alphabetical order - how can I change this so they are based on a different order - eg by the descriptions corresponding ID

View 3 Replies View Related

Queries :: Fixed Heading Names In Crosstab With Dynamic Columns

Jul 3, 2014

I'm trying to run a query which fetches only the last 2 years of data for a given region from a table with several years worth of data (there are year, region, sector and rank columns among others). The region is passed into the query from a combobox from Form1.

The first problem was that some regions have up-to-date data and some not so much e.g. for Europe the "last 2 years" mean 2012,2013 for Asia its 2011,2012. In order to deal with this I've created a crosstab query which works well except for one thing - because the columns are dynamic (dependant on the region) the column headings change as well.

And here comes my question, how can i fix the column names to be e.g."Current Year" and "Prior Year" independent of the query fetching 2012,2013 or 2009,2010? I've tied different things with PIVOT... IN ... but with no luck.

Here's the sql for the query:

Code:

PARAMETERS [Forms]![Form1]![cmbRegion] Text ( 255 );
TRANSFORM min(DataTable.Rank)
SELECT DataTable.Region, DataTable.RegionalSector,
FROM DataTable
WHERE (((DataTable.Region)=Forms!Form1!cmbRegion))

[Code] ....

View 7 Replies View Related

How To Get Dynamic Sum

Aug 25, 2006

Hey,
I made a table Products: order number (key), name, supplier, price,...
I copied it into a query, and made a form of it, so I can look up products by order number with a combo-box. Now I'm into my next step (and it gives me a headache):
In the form I added a new text box, where I should put the incoming amount of a product in, and another text box to put in the products that are empty.
Now the question: how can I make a query that counts the amounts of incoming and empty products, as well as the difference between those two, in a way I can do multiple additions?
I hope you know what I mean by dynamic sum: start stock=0 first delivery: +3==> stock 3 +next delivery: +6 ==> stock 9,...

If anyone has some idea...
Thanx in advance

Kev

View 1 Replies View Related

VBA Dynamic Forms

Oct 8, 2006

Hi guys, I am trying to create a form or subform that should be created after a button is pressed and some complex filetering is occured and records are saved in a multiple arrays so I need to generate a form and controls according to those array values. Please help.

Actually I can not get data directly out of the query its just too complex bla bla bla. Finally I have three arrays each array has same number of values and I want to generate a form on the basis of the values of the array. Please Help me. I have tried creating form but Could someone please show me the right path.

many thanks

View 1 Replies View Related

'Dynamic' Selection

Oct 12, 2006

Now, I don't know if this topic should be in forms, queries or reports, so I decided to post it here in general until someone gives me a big bollocking and send this topic elswhere :D

I have a table with loads (50+) of columns which hold information about people in our company.
What I want is a form? that allows me to tick the information I want and then displays the result in a report.
So, today I want a list with Name, address, town and phonenumber, but tomorrow I might need a list with Name, phonenumber, passport number and expire date.
In short, I need to make a 'dynamic'? report that displays the options I ticked out of the 50+ options (does this make sense?).
I searched for it but no luck so far.
Ta in advance

View 4 Replies View Related

Dynamic Arrays

Jan 24, 2008

Hi,

How can I determine the length (size) of a dynamic array so I can iterate over it?

Thanks,
Mike

View 2 Replies View Related

Dynamic Listboxes

Jul 17, 2005

Hello,

I have two tables: Categories and Subcategories.

Categories contains one field: CategoryName
Subcategories contains two fields: ParentCategoryName and SubcategoryName.

In a third talbe I want to select a category from a listbox, then have the subcategory listbox update automatically with the possiblities. Is this possible?

Thanks.

View 1 Replies View Related

Dynamic Numbers

Jul 14, 2007

Not sure that this fits under table but I believe that is the root of the solution, so we'll try it here.

I'm building a database to simplify the process of creating a PC build sheet for my company. I would like it to track pricing and everything as well so here is where the problem comes in:

Say right now a floppy drive costs our customer 10 dollars. In a few months, we could still be using the exact same floppy drive, but the price has dropped to 9 dollars. If I run a report to display all computers sold in the past year (including pricing), I want the floppy to have the price that the customer paid at the time; not the latest 9 dollar price only.

Correct me if I'm wrong, but here is my thinking:
I could run a macro to rename the $10 floppy drives and update it in all old records (though I have a feeling I'd have to pull a trick out to mess with UIDs) then update the price on it for the list of options when building out a computer, but it seems like I should be able to automate this better.

Possibly some sort of linkage table?

I'm just trying to keep this as clean as possible so I'm not digging back through this a year down the road.

View 3 Replies View Related

Dynamic Query Help

Feb 7, 2007

I have a form where a user chooses different criteria from listboxes and then I run out and format the SQL statement.

This is the query that I am trying to replicate using VBA code. Note: the Location_ID, Ship_Day, and Final_Dest come from the values in the listboxes.

I am getting a syntax error and I cannot find it anywhere. Also, is there an easier way to do this?


SELECT [(Table) Denton Routing].LOCATION_ID
, [(Table) Location].NAME
, [(Table) Location].CITY
, [(Table) Location].STATE
, [(Table) Location].REGION
, [(Table) Denton Routing].UNIQUE_LANE_ID
, [(Table) Denton Routing].CARRIER_ID
, [(Table) Denton Routing].[SHIP DAY]
, [(Table) Denton Routing].[DELIVERY DAY]
, [(Table) Denton Routing].[TIME AT LOCATION]
, [(Table) Denton Routing].STOP_NUM
, [(Table) Denton Routing].NO_OFF_STOPS
FROM [(Table) Location] INNER JOIN [(Table) Denton Routing] ON [(Table) Location].[LOCATION ID] = [(Table) Denton Routing].LOCATION_ID
WHERE ((([(Table) Denton Routing].UNIQUE_LANE_ID) In (SELECT UNIQUE_LANE_ID
FROM [(Table) Denton Routing]
Where [(Table) Denton Routing].Location_ID = "13176AA"))
AND (([(Table) Denton Routing].[SHIP DAY])="MONDAY"
AND [(Table) Denton Routing].Final_Dest = "DENTON"));

Here's the code:

Private Sub cmdRunQuery_Click()

Dim Db As DAO.Database
Dim QD As QueryDef
Dim where As Variant

Set Db = CurrentDb()

' Delete the existing dynamic query; trap the error if the query does
' not exist.
'On Error Resume Next
'Db.QueryDefs.Delete ("Dynamic_Query")
'On Error GoTo 0

where = Null
where = "WHERE ((([(Table) Denton Routing].UNIQUE_LANE_ID) In (SELECT UNIQUE_LANE_ID FROM [(Table) Denton Routing] where"
where = where & " [(Table) Denton Routing].[Location_ID]= '" + Me![Text35] + "'"
where = where & " AND [(Table) Denton Routing].[Final_Dest]= '" + Me![List29] + "'"
where = where & " AND [(Table) Denton Routing].[Ship Day]= '" + Me![Combo46] + "'))"

MsgBox (where)

Set QD = Db.CreateQueryDef("Dynamic_Query", _
"Select SELECT [(Table) Denton Routing].LOCATION_ID, [(Table) Location].NAME, [(Table) Location].CITY, [(Table) Location].STATE, " & _
" [(Table) Location].REGION, [(Table) Denton Routing].UNIQUE_LANE_ID, [(Table) Denton Routing].CARRIER_ID, [(Table) Denton Routing].[SHIP DAY], " & _
" [(Table) Denton Routing].[DELIVERY DAY], [(Table) Denton Routing].[TIME AT LOCATION], [(Table) Denton Routing].STOP_NUM, " & _
" [(Table) Denton Routing].NO_OFF_STOPS FROM [(Table) Location] INNER JOIN [(Table) Denton Routing] ON [(Table) Location].[LOCATION ID] = " & _
" [(Table) Denton Routing].LOCATION_ID " & (" where " + Mid(where, 6) & ";"))

DoCmd.OpenQuery "Dynamic_Query"

End Sub

View 5 Replies View Related

Dynamic Sorting...

Oct 19, 2007

Say I have 3 fields in my table: FstName, MidName, LstName.

I want to be able to dynamically change the sort order of a query to different sort orders using the same fields via a form.

I may want to see the records sorted by LstName, MidName, Fstname; and another time see the list sorted by Fstname, Lstname, MidName; and other times by any combinations possible using the 3 fields.

I see 3 options: filter by form; programatically change the SQL Order By clause; or concatenating the table fields together in the desired order via a custom function and sorting by the function result.

Is there any difference in query/form performance between the 3 options?

View 3 Replies View Related

Dynamic Look Up Problem

Feb 25, 2005

NEW PROBLEM! :)

Sorry for the double post.

View 2 Replies View Related

Dynamic Subform

Apr 14, 2005

Hi all, I'm currently strugging with an Access problem and wondered if anyone here could give me some ideas. This is fairly complicated to explain, so please bear with me!

Basically, I have a query that pulls out a list of users, and another query that pulls out of a list of possible applications that that may be assigned to them.

What I need to do is present this in a form, so that my app user can browse through the list of users, and assign/deassign applications to that user. I'm thinking of presenting this along the lines of a list of users down the left of the screen, a list of apps along the top of the screen, and a checkbox for each app/user combination.

The complication is the list of possible applications is different every time the form is loaded. There are 1500 possible apps, and ANY combination of these may be available.

My most recent attempt at this was to find the list of apps, and then (using vba) create a temporary table, with a "User id" field, and then a "yes/no" field for each app that is available to this group of users. I can then present this in a subform, allowing the tickboxes to be viewed and modified for each user/app combination.

However, my problem is that when I dynamically try to alter the recordSource of the subform, the field names are different each time, so it doesn't display the app names I need. I've searched Google etc, and the only relevant suggestion is to have multiple subforms, and display the one that suits. However, with such a huge number of possible combinations of apps, I cannot take this approach.

So, is there any way that I can easily update the subform to have the correct columns? Or am I going about this in entirely the wrong way?

Any suggestions will be gratefully received - I'm hitting a brick wall with this at the moment and don't have much hair left to pull out!

View 1 Replies View Related

Dynamic Subform

Apr 3, 2006

I have a main form that displays different part numbers and the corresponding material type for each item. For example,

Part 1 metal
part 2 candy
part 3 label

I have created specific subforms based on the type of the material. I want to place a command button on each record, and when the button is clicked, the correct subform based on the material code will open. For example, the above 3 items are displayed on the form, if the user clicks the button next to candy, then the candy subform opens and if the user clicks the button next to label, then the label subform opens.

Thanks for helping solve my question.

Jeff

View 1 Replies View Related

Help With Dynamic Reports

Aug 22, 2004

hi,
i'm having a problem making my report dynamic, i have a query which returns the
payments due in the next month, my question is, if i have a form based on this query,
how can i make it so that, if i need to print an invoice for one of the customers, lets say the currently displayed record,
how can i limit the customers displayed in that report (invoice) to just the current record that i want the invoice for?

Thanks

View 4 Replies View Related

Dynamic Default Value

Mar 21, 2012

I have several tables but lets focus on two Table1 and Table2

Table1.ID is a foriegn key in Table2.NewID

I want the default value for Table2.NewID to be the MAX of Table1.ID; that is I want Table2.NewID to auto default/select whatever is the highest ID of Table1.ID. I have toyed with this as much as I can by entering different SQL statements in the the default field of the datasheet. And by defining different Macros for OnFocus event.

View 1 Replies View Related

Dynamic Hyperlink Base

Aug 2, 2005

I am looking to basically update the hyperlink base every time the database is opened to be the folder that the database is currently in.

We are trying to make the database and supporting information portable, so that people can copy the entire folder anywhere on their computer and all of the links will still work. I can't put all of the info in the database because we are already pushing the size limit.

I would like to keep it from getting terribly complicated, as others will have to update this database with more info in the future and make the links themselves.

If there is a better or different way of getting the same result without going through the hyperlink base, that is fine.

Any help would be appreciated.

Thanks.

View 14 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved