473,394 Members | 1,889 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Hi... Updateable Query Error with a Subquery

Hello everybody,

I am completely new to access and am facing a problem.

I am trying to run the following query from the query designer ( i am using access 2000 and the table that i am trying to update is created by me ) and I am getting the error 'Operation must use an updateable query'

UPDATE ac_online_scanned_tkts_1 SET ac_online_scanned_tkts_1.Batch = ( Select Max (temp.batch) as t1 from ac_online_scanned_tkts_1 As temp )
WHERE ac_online_scanned_tkts_1.batch = 0;

What i want to do is update the field Batch with the current max value of Batch in the same table plus 1.

Any help and response is appreciated !!!
Thanks in advance
Jun 6 '07 #1
2 1836
cyberdwarf
218 Expert 100+
Hello everybody,

I am completely new to access and am facing a problem.

I am trying to run the following query from the query designer ( i am using access 2000 and the table that i am trying to update is created by me ) and I am getting the error 'Operation must use an updateable query'

UPDATE ac_online_scanned_tkts_1 SET ac_online_scanned_tkts_1.Batch = ( Select Max (temp.batch) as t1 from ac_online_scanned_tkts_1 As temp )
WHERE ac_online_scanned_tkts_1.batch = 0;

What i want to do is update the field Batch with the current max value of Batch in the same table plus 1.

Any help and response is appreciated !!!
Thanks in advance
You could try using the DMAX function to grab the max value first, eg
Expand|Select|Wrap|Line Numbers
  1. Dim MaxVal As int
  2. MaxVal = DMax("Batch", "ac_online_scanned_tkts_1")
You can now use this value instead of the sub-query
Expand|Select|Wrap|Line Numbers
  1. Dim Sql as String
  2. Sql = "UPDATE ac_online_scanned_tkts_1 SET ac_online_scanned_tkts_1.Batch = " & MaxVal & " WHERE ac_online_scanned_tkts_1.batch = 0"
Don't know if this gets you any nearer...

Steve
Jun 6 '07 #2
Thanks for the reply. I did use the DMax function, but directly in the query, and it worked fine.

Thanks again.
Jun 14 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Tom wilson | last post by:
This is driving me nuts. I'm trying to update an Excel spreadsheet using ADO.Net and Oledb in VB.Net. The connection is open, the adapter is connected and the dataset is loaded. Here's the code...
4
by: Jim in Arizona | last post by:
Continuing my lessons out of a book, I ran into a problem when trying for the first time to update a datastore (access database in this case). My Code: Private Sub Page_Load(ByVal sender As...
4
by: Sebastian Böck | last post by:
Hello all, i have a view defined as a simple select of a table. This table is inherited by a couple of others. All entries belong to the child-tables. I also have an unconditional update rule...
5
by: Web Search Store | last post by:
I'm getting this error on my web page: Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80004005) Operation must use an updateable query. /searchweb33.asp, line 5014 Here is the...
8
by: Jim in Arizona | last post by:
I've been using an example out of a book to be able to edit the rows in a database. I am getting the following error: ========================================================...
27
by: Bob | last post by:
running access 2k; mdb w/ linked tables to another mdb (front/back-end); trying to run a query that updates a table FROM information from a crosstab query. I AM NOTT trying to update the...
11
by: Arpan | last post by:
I have always been working with SQL Server 2005 for ASP.NET apps but due to some reasons, had to revert back to MS-Access 2000. When I try to insert/update a MS-Access DB table (MDB), ASP.NET...
4
by: Mike D | last post by:
OS: Windows XP Professional Microsoft Access 2003 I am trying to update a table in my DB from a tempory table. I need to ensure that if records in the main table match records in the temp...
1
by: wquatan | last post by:
I have a problem with an Access Update-Query (made in the designer) for a SQL-server Table. The Query consists out of the Table to be updated, and a joined "Select" subquery to provide the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.