I was trying to create a chunk of code like follows:
Dim qry As DAO.QueryDef 'the actual query to be generated
Dim qryName As String 'the name given to the query
sql = "SELECT * INTO AppendAllFields FROM [some table];"
Set qry = db.CreateQueryDef(qryName, sql)
where qryname is alr. defined.
When I wronf it, it kept giving me the error on the DoCmd line saying
that runtime error 3001, invalid argument....
Anyone could help?
On 27 Apr 2007 11:09:43 -0700, email@example.com wrote:
>I was trying to create a ch...CrossTab Query that shows original data (text)
I am a scheduler and would like to build a pivot table in Excel or a Cross
Tab Query in Access that shows the data in its original form (text) instead
of calculating the count, sum, avg., etc.
Row headings would have member’s names. Column headings would have times.
Data items would be the name of the assignment.
Any suggestions would be appreciated.
You can use a text field for the Value of a crosstab with FIRST or LAST or
MIN or MAX.
Microsoft Access MVP
If I have helped you, please help me by donating to UCP
http://www.access.hookom.net/UCP/Default.h...crosstab query question 01-26-08
I'm using A 2000. I've created a crosstab query that finds data based on a
date range that I supply just before opening it. The query will add or
remove columns depending on that date range, and it will label the top of
the column with the appropriate dates.The query works perfectly.
One of the fields in the query is a UserName. I want to be able to double
click the Username, and have it open a form and go to that Username's
Of course, queries don't have events like a form does. So I don't see any
way to open my filtered form from a record in the query.
If I base...Query of External Data
I'm using a ODBC connection to query a oracle database. If I refresh a query
and email the file to the intended recipients, I can limit what they can see
by changing the query to include/exclude certaing markets.
Is there a way that I can set up the query so the recipient cannot edit the
query and have access to all the data...?
Or is there a way to disconnect the query from the excel file, this way the
query could never be refreshed to the database. We could email them the file
daily, but they wouldn't be able to refresh or change the query(to view
markets they normally ...Stored Procedure pass through SQL Returned the following results:D
We are having an issue, after upgrading to SQL 2005 and GP Version 9. The
error involves a few different stored procedures and happens very
sporadically. Usually it will continue until the users logs out of Great
Plains and gets back in. We have rebooted the SQL server a number of times.
We get other stored procedure SQL pass through errors that includes
pmPayablesSummaryInquiry, createSQLTmpTable, PopulateRMOpenTempTable and
PopulatePMOpenTempTable. Again, these errors happen sporadically with no
The exact error usually reads "The stored procedure XXXXXX...INSERT / UPDATE Query in same operation
This is a backend database for .NET application
Table1 is a linked table to a text file on the network, which is updated
from an ERP system.
Table2 is the table my application uses when the PC is offline.
I want to update Table2 with Table1 on those rows who exist in both tables,
and insert the new rows from Table1 into Table2,
in the same SQL call.
Is it possible at all?
No. However you could put both queries in a macro or code and they would run
so fast that you wouldn't know the difference. You could even Set Warnings
off before the first quer...ISV.config query
Im not a programmer and have limited experience with coding etc. However I
wish to add a button to the account page/form via the isv config file. I
want this button to get the website address of the company from the form and
then use it to open the company website in a new window.
Could anyone give me an indication of how to do this or even a sample bit of
code...? This would be very helpful
Thanks in advance
The easiest way is probably for you to take a look in the
isv.config file and just copy and paste. The test.gif and
the url is just an example!
Here is an example of...Unable to bring back all results from table with query
For a uni assignment we have a designated query that we have to create.
But when I run the query, I get one result returned to me. I should have two
returned to me, as I have two records in the Problem table.
The SQL is:- SELECT Problem.[Problem Number], User.[User ID], User.[User
Name], User.[Job Title], User.Email, User.[Telephone No], Asset.[Asset Code
No], Problem.[Problem Description], Problem.[Current Activity Log],
FROM [User] INNER JOIN ((Asset INNER JOIN Problem ON Asset.[Asset Code No] =
Problem.[Asset Code No]) INNER JOIN [Contact Log]...get value from a query /set a variable for a report
I put this question in the forms area -- it is a form/report problem. - don't
mean to double post, but I should have put it in this area instead. sorry!
I have a report that shows the detail for 3 different values of a field
named "TransType": (values: pmt, adj, act).
The name, date, and TransType fields are set via a form. In the report, I
want the detail to show for the chosen TransType(s), name, and date. AND I
want a total of the "ADJ" records for the specified name and date to show in
a field in the footer.
strDocName = "Sales for 1 month&...Creating a graph of top ten results
Im creating a database to monitor machine downtime on Access 2000. There are
168 different fault alarms that cause downtime incidents. I'm trying to
create a report in a graph format that will only show the top ten fault
alarms, ie, the ten fault alarms that occur the most. Thanks for the help.
...Using external query (mdb) for dynamic date range
I'm trying to set up an Excel workbook with a dynamic link to an Access
database containing quality data, involving dates. I want the workbook to
always import data for the last 90 days. When I try to set this up using MS
Query, to try to filter data I've tried several different variations where
time is greater than or equal to:
And every time, it comes back as an error. It seems to be setting the query
so that the entire statement is a date variable, eg "Syntax error in query
expression '((Table1.Time>=#date()-30#))'...Query data from same workbook
Hello all -
I have an excel workbook that queries external data that is stored on a
different workbook but same computer. It works fine and I haven't had any
issues with it. But, now I need to make this workbook easy to send to other
users. I would like to consolidate the data and put it on the same workbook
with my written queries. I figured it would be easy to do, similar to doing a
pivot table on sheet1, and the data source on sheet2. This would make it much
easier to send out to all the users so it can find the "data source" every
time regardless of who's computer ...Change Connection of a Query
Hi I try to modify a Query, i want to change the server where the query is
pointing to. How can I do that?
need specifics, lots of ways to do it....
post current query connection string
ie: code with current server address
> Hi I try to modify a Query, i want to change the server where the query is
> pointing to. How can I do that?
...Query to find outliers
I have two tables, one table listing names of people who did not receive a
gift card and a second table of people who were taxed for the gift cards.
Both tables use the name field ( I did not set up the tables but this field
is first and last name) in common. I need to find out if there are people on
the tax list who did not receive a gift card. So if a name is on the tax list
it should not be on the did not receive list. Therefore, they were taxed for
the card but never received it.
...Sorting a query with a twist
I have a query I am trying to create based on another query
(inventory) and a table. The inventory query shows the date, shift,
Die set and the # of shifts remaining for each die set in inventory.
The table has a corresponding date and shift field as well as two more
fields that tell me what die set was left in the line at the end of
the previous shift and what die set is staged to go in next (again
left from the previous shift). When the inventory query is run it
tells me what die set has the lowest inventory to the highest.
However, the die set with the lowest inventory may not be the one
...Pass through query giving an invalid column error
I am trying to write a pass through query using Access 2000. My source table
has a field that has three blank spaces as a place holder. I do not want or
need records that have three blanks in this field as well as records numbered
840. I am trying to write an SQL statement that will eliminate those records
from my query. I am using the following code:
WHERE ((Not ( [table].[field] )= "840" or Not ( [table].[field] )=" "));
I get an error at line 3 invalid column name '840' and ' '. I can remove
the quote...GENERATE RANDOM NUMBERS TO FIT INTO RESULT OF PARTICULAR NUMBER
HI TO ALL, I NEED HELP WITH SOME PROBLEM......
what I need is to randomly generate numbers (each with different
condition, some between 1 - 5, some between 10 - 20 ect) wich will fit
at summary into particular number I want.
5 - numbers that will be randomly generated to fit into result 20
20 this is number I put by myself into column
any advice are willcome......pls
I did some research but it seems to me that maybe I need to use visual
basic for this wich i dont know.
so you want to tell excel how many numbers you need and the value t...Unmatched Query 01-08-08
I have an unmatched Query that should be returning a result but doesn't any
help is appreciated.
SELECT tblMenuSchedule.SchedTerminalID, tblMenuSchedule.SchedMenuID,
FROM tblMenuSchedule LEFT JOIN Days ON tblMenuSchedule.SchedStartDay =
WHERE (((tblMenuSchedule.SchedTerminalID)=[forms]![frmMM]![TxtID]) AND
((Days.DayID) Is Null));
Perhaps more info! I have a list box that shows days of the week, basically
I want that listbox to show the days of the week that are not...Help w/Query
I am trying to build a query based on 2 tables. Main Table has Entry#, Date,
Location, Product1, Amount1. Product Table has ProductID, Content, and
Catagory. I am trying to add the Content and Catagory for the product that
is selected in the main table. Because later on i need to sum up the amount
of product in each catagory.
So far i have an append query with the tables i need. I have a join between
product1 and productID where all records from main table and only records
from Product Table where those are equal.
When i run the query i get product1 listed for every content and cat...query two tables, changing font of changes?
I'm quite the novice, but is there a way to build a query to compare table a
and table b and only return table a with the differences from b in red font?
or something similar?
(I am having to find the changes needed in a database by device sn, ex:
location, ip address updates etc...)
if I have two tables one being an extract from my db and one from all the
new info, can i produce a "needed changes" query with red fonts representing
the changes needed?
I hope i wasn't too confusing..
On Thu, 14 Jan 2010 16:45:01 -0800, michelle1...VLOOKUP/HLOOKUP Query
Hope I can explain this clearly enough .
I have c 50 branches of a retail outlet, each of which have a bank account
that is used on a daily basis. The accounts are, however, cleared to a
central account at the end of each month by way of an automatic transfer.
I need to set-up a monitoring system so that I can track the cumulative
balance at each outlet, even though some of this will no longer be showing
on the respective bank accounts (after 31/1/10 - the first clearance date).
I am advised each month of the amounts transferred to the central account
and then have to do week...Query wants parameter value
I have a tools database which been used for over 12 months on a network
at work. Just lately I have noticed that on the main tools query, when I
open it to do some filtering for locations or tools, I am asked for a
parameter. If I just click ok, and not enter anything, the query runs.
It didn't used to ask for a parameter, so I don't understand why it is
doing so now.
This query is used to select the different tool types from a combo box
in the main form, so I don't want to change anything that would stop the
The SQL for the said query is below:...print query prompts in report header when no data to report
a report which uses a Query with prompts(expr1: xyz) and other criteria
selects no records. The report header prints, but (expr1) which is a field in
the header is blank. I want the prompts to print in the header even when no
data is found.
If you use references to controls on forms, the values will always be
available even if the query returns no records.
Microsoft Access MVP
If I have helped you, please help me by donating to UCP
> a report wh...Workflow action working only on visible grid result set?
can anyone answer this question: On calling a context action (i.e. "workflow
rule") on a query result set, does the action/workflow perform on the
"visible set" (limited to 25, 50 or 100 records) or on all records that meet
the search criteria?
Thanks a lot!
If I am following your question, the "Apply Rule" action will apply
the rule to the selected (highlihted) objects in the current view.
On Mon, 1 Mar 2004 09:15:41 +0100, "Achim Gounar"
can anyone answer this ...CrossTab Query
I have two questions regarding setting up a new "small" Access 2007 database.
First off, I'm new to designing databases, so I may not ask my questions
using the correct terms. I do want to learn how to do this the right way, so
please correct my terms so I can speak your language.
Below is a sample of the data that will be used. The data consists of type,
items, years, and amounts. The amounts values are "totals" as seen below,
and are either number, percentage or currency. There can be some Null values,
where the number is not known.
Type Item ...