Hi,
I have a table (Stock) important field are partsNo., des, qty, pPrice, sPrice, qtyBuy. I make a query based on the table and has one more field SAB(qty+qtyBuy) . I made a form based on the query. User can enter data in any field. When I enter data in ‘qtyBuy’ field I can see the added value by SAB field.
My obligation is to set this value into stock table in qty field. To perform this action I run an action query in a macro in qty field after update event on the form. But when I run the macro, I receive a message ‘Writing Conflict’. If I press ‘save record’ all data are saved expect running macro but if I press copy to clipboard only macro related field(qty in stock table) is updated other fields don’t update.
Please give me a guide what can I do?
Query code is:
“SELECT Stock.partsNo, Stock.des, Stock.qty, Stock.pPrice, Stock.sPrice, Stock.qtyBuy, nz([Stock]![qty])+nz([Stock]![qtyBuy]) AS SAB
FROM Stock;”
Macro code is:
“UPDATE Stock SET Stock.qty = [Forms]![Add Parts]![SAB]
WHERE (((Stock.partsN o)=[Forms]![Add Parts]![partsNo]))”
3 1882 NeoPa 32,573
Recognized Expert Moderator MVP
Bidhan,
With your form open, you are basically running a query which locks the underlying tables (at least the records), so any action query on the same tables (as this is) would be likely to clash.
As I suspect that BuyQty is a temporary variable, it should probably not be part of the form but as a separate form-only field. When the operator enters a value in this field (or when the form moves away from the current record) your code should update the Qty field by adding the BuyQty. You could also include the SAB field (Form only - not bound to table) if preferred.
PEB 1,418
Recognized Expert Top Contributor
Maybe it should be better to update your fields using VBA in your form instaed using Update Action query?
NeoPa 32,573
Recognized Expert Moderator MVP
I would always recommend the SQL action query myself, if it can be made to work (My experience is that it performs more efficiently - faster).
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Adam |
last post by:
Hi
I had Ruby 1.6.8-8 for Windows installed on my WinXP Pro machine prior
to installing Python 2.3. After installing Python 2.3, I tried to
<----- screen output of python interactive command line ----->
Python 2.3 (#46, Jul 29 2003, 18:54:32) on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from Tkinter import *
>>> root = Tk()
|
by: VHR |
last post by:
Hi,
I apologize for posting this a second time, but no one replied from
the other group where I posted it.
I have a design master and 4 replicas that I have successfully synced
on about 4-5 occasions. However, one of the replicas apparently
corrupted, and I was able to fix it by compacting and repairing.
Every time I open the database now, the conflict resolution viewer
pops up and says there are conflicts, but shows no conflicting...
|
by: vb |
last post by:
Hi,
Sorry, I am new to C#, so this can be a very simple question.
I am using some of DevExpress components in my application.My References in
the Solution(for DevExpress) are:
DevExpress.Data;
DevExpress.Utils;
DevExpress.XtraBars;
DevExpress.XtraEditors;
|
by: Abubakar |
last post by:
Hi,
on some opensource group when I tried to compile there compiler with vc++
someone said this to me:
"BTW, does the VS.NET license even allows one to write compilers with it?
I remember reading the Visual C++ once and it expressly prohibited writing
competing products (including compilers)."
Is this true?
Ab.
|
by: crystal |
last post by:
I've checked the threads but haven't been able to come up with a
solution to my issue. Help......
I have a simple form based on a table.
Within the form is a subform that is also, through a Q, based on the
same table.
The code:
Private Sub Select_BeforeUpdate(Cancel As Integer)
On Error GoTo resetselect_Err
| |
by: onnodb |
last post by:
Hi all,
In the past few weeks, I've been struggling with setting up an Access
(XP) user interface to a MySQL database. So far, I seem to have been
able to overcome most of the difficulties, but I'm still stuck with
those famous writing conflicts one gets when coupling Access and MySQL.
I've made a simple test case: a small table containing the following
fields:
|
by: lotus18 |
last post by:
Hello World
I have a problem in detecting the conflict schedule (Day and Time).
Day
1. M
2. T
3. W
4. TH
5. F
|
by: lotus18 |
last post by:
Hello all
I have these records on my Day Table for my complete database table please click here
1. M
2. T
3. W
4. TH
5. F
6. S
|
by: =?ISO-8859-1?Q?Gerhard_H=E4ring?= |
last post by:
egbert wrote:
No, it's just like every other database error - the command fails but
the connection is left untouched.
Sure, the successful ones ;-)
FWIW, this restriction is not any longer true in Python 2.6 and 3.0 btw.
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |