ms-access

Using function from form in Access SQL statement?

Hello, I know if I make a code module in Access and place a function in it, I can run a query that has embedded calls to that function. However, I want to know if I can get a function that belongs to the code part of a form to be recognized by Access in a query. So far I cannot find a way, but it seems to me that this should be possible...

Flatten relational data for summary/export

Say we have two tables in an MS Access db: Service Users: | ID | Name | Other details... | | 1 | Joe | Blah... | | 2 | Fred | Qwerty... | | 3 | Bob | Something else...| Teams providing services: | ID | TeamID | UserID | | 1 | T1 | 1 | | 2 | T2 | 1 | | 3 | T2 | 2 | | 4 | T3 | 2 ...

Pivot Chart Creation Using Access 2007 VBA

OK there are absolutely no good articles on the internet that I can find that explain or have code examples on how to create a pivot chart using VBA. I need this because I need the pivot chart to show different results depending on user selection in a form. There are some for Excel but the syntax is different for Access. I know this is a...

How to Replace Multiple Characters in Access SQL?

I'm a novice at SQL, so hopefully someone can spell this out for me. I tried following the "Replace Multiple Strings in SQL Query" posting, but I got stuck. I'm trying to do the same thing as the originator of the above posting but with a different table and different fields. Let's say that the following field "ShiptoPlant" in table "...

How to execute a literal in VBA?

Is there a way to execute a literal such as, UseValueKey = ExecuteMethod("Date()") I want to have the variable UseValueKey return the actual date. I am using VBA. Any ideas? ...

Subtyping database tables

I hear a lot about subtyping tables when designing a database, and I'm fully aware of the theory behind them. However, I have never actually seen table subtyping in action. How can you create subtypes of tables? I am using MS Access, and I'm looking for a way of doing it in SQL as well as through the GUI (Access 2003). Cheers! ...

VBA - Parse Email Text to Access 2000 Class Instance

I am now maintaining a legacy VBA/Access 2000 application for a client. They have a customer who emails orders with text that looks like this Contact: Peggy Hill Company: Arlen Residential Mortgage Finance Co Address: 43456 South 18939 West, Suite 47995 City: Arlen City ContactState: TX ContactZip: 88888 Phone: 8019990000 Email: peggy....

SQL Help in Access – Looking for the Absence of Data

I am trying to find the fastest way to find all of the records in a parent table that do not have certain records in a child table. For example, I want the query to return all of the family records where there are no male children or no children at all. Example 1 This is painfully slow: SELECT * FROM Families WHERE Families.FamilyID ...

access 2003 adp opened & saved in 2007 now behaves odd in 2003

I inherited an access 2003 ADP file which uses sql 2000 as it's data source. This is my first access maintenance project and not thinking about the issues involved simply opened it in access 2007 on my dev machine. It of course worked and I proceeded to do the work requested. I have completed the work and presented the file to the clie...

Update an Access Link Table when the underlying SQL Server table's columns change

At work we've got a SQL Server database that several users connect to (read only) using Access 2003. This was fine, except now one of the tables they look at is re-created fairly often and part of this process involves a cross-tab query. Which means that, depending on the data, the number and and names of the columns potentially change...

Having Syntax errors Joining 3 tables

I am trying to join 3 tables with the following sql statement Select Sum(OrderDetail_table.Price * orderDetail_table.quantity) as totalPrice, item_table.GLacct from OrderDetail_table left outer join order_table on orderDetail_table.orderID = order_table.orderid left outer join item_table on it...

Dash in a field name in access database table

Hi, Im having problems retrieving a field from my ms-access database. The table name is TEST and one of the field's name is HD-TEST When i do: SELECT * from TEST where TEST.HD-TEST='H' and i execute the query, ms-access shows me a dialog expecting the parameter HD. Do you know what could be the reason? Thanks a lot. Kind Regards. ...

Microsoft Access string parsing

In MS Access 2003, I have the following values in a column 0-0-60 20-0-0-24S 20.5-0-0-24S 32-0-0 How can I write my query such that I can pull the 3rd item from the column, example the "60" from "0-0-60". Keep in mind that I've optionally got the 4th column also. ...

Automatically Generate SQL from existing MS Access table

I've just designed a large database by playing around in MS Access. Now that I'm happy with the design, I need to be able to generate this same database (tables, relationships, etc.) from code. Rather than hand-writing the SQL CREATE statements (which will be long, tedious, and error-prone process), I was wondering whether there was a s...

problem with SQL statement in high score database

I have created a letter game in java and i need to include a high score function into it. Using Microsoft access database through JDBC. The table in the database contains the following Table name Easy fields Name Score Time In need an SQL statement that displays the top 5 scores in the order highest score and lowest time. eg. if the...

Migrating an Access data table to SQL Server 2005

I used the standard import / export tool to bring a table into my SQL database. The dates all came over as CHAR types. Now, I keep getting a conversion error stating the CHAR to datetime resulted in an out of range condition. Help please. ...

System.Data.OleDb.OleDbException: Too many fields defined

I'm working on building a .NET WinForms application to replace a series of forms in a Microsoft Access (insert collective groan here) database. In an effort to get the initial version finished, I am attempting to use the existing queries rather than digging into the data model and its obvious design problems. I'm calling the queries us...

Access Query Error - Null & Variant Data Types - How do I fix this error?

All, This error is driving me insane. I've spent 2 hours trying to figure it out and/or work around it with no luck. Here's the error: "You tried to assign the NULL value to a variable that is not a Variant data type." Here's my SQL: SELECT tbl_budir_002.Location_Index, tbl_parent_001.NEWPARENTID INTO tbl_budir_003 FROM (tbl_budi...

Access query (SQL) to return records sorted (grouped by) WEEKS

Greetings SQL gurus, I don't know if you can help me, but I will try. I have several large databases grouped by year (each year in a different database). I want to be able to compare values from a particular week from one year to the next. For example, "show me week 17 of 2008 vs. week 17 of 2002." I have the following definition of w...

How do I Insert values into a Microsoft Access Database through JDBC?

I have created a letter game in Java and I need to include a high score function in it using a Microsoft Access database through JDBC. The table in the database contains the following fields Table Name: Scores Name (Text) Difficulty (Text) Characters (Number) Accuracy (Text) Time (Text) Score (Text) I need a SQL st...