473,395 Members | 1,996 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,395 software developers and data experts.

Writing Conflict’

2
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.partsNo)=[Forms]![Add Parts]![partsNo]))”
Nov 23 '06 #1
3 1869
NeoPa
32,556 Expert Mod 16PB
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.
Nov 24 '06 #2
PEB
1,418 Expert 1GB
Maybe it should be better to update your fields using VBA in your form instaed using Update Action query?
Nov 26 '06 #3
NeoPa
32,556 Expert Mod 16PB
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).
Nov 26 '06 #4

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

Similar topics

0
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...
0
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...
0
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;...
4
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...
4
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,...
3
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...
14
lotus18
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
14
lotus18
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
0
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...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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
jinu1996
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...
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...
0
agi2029
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,...

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.