Simple Update Query

A

Azad

Hi,
I have two tables linked as one to many relationship.
Table Disc_Desc (one) and Table Jobcard (many)
What I am trying to achieve is to sum from the Jobcard Table the tota
Hrs by each discipline (field called Disc) and then Update
these values into the Disc_Desc table.
In my update Query I am doing the following :

Disc_Desc Table (on the update query)
Update To:
DSum("[Mhr]","Jobcard","[Disc] = " & [Disc])

When I run this query I get the message that Access cannot update
the records due to conversion failure,key violation,lock violation,&
validation rule violation.
Any help would be appreciated.
regards
Aza
 
M

Michel Walsh

Hi,


I assume Disc hold some text data, I am right? If so, try

UpdateTo: DSum("Mhr","Jobcard","Disc = """ & Disc & """" )
1 1 1 1 1 3
4


since we have to delimit the text. I assumed your string do not contain a
double quote (I use it as delimiter). The numbers in the second line
indicate the number of successive " there are in the line above.




Hoping it may help,
Vanderghast, Access MVP
 
A

Azad

H,
many thanks.I tried the query that you gave.I no longer get the
error messages.However the summation of Mhr by Disc (field) from th
Jobcard Table (many sided) does not update the TotMHR (field) in th
Disc_Desc Table (one sided).It returns 0 values.
Regards
Aza
 
L

L. T. Portella

Michel
could you help me with the following which appears to be the simplest
version of an update query.
Thank you for your help

Append query?


1. Using Access 2000
2. Have two tables Mtable and Ctable
3. Both tables have identical fields i.e. name and address
4. Three different people in their own computers input daily info in their
own copy of Ctable
5. At the end of the day I want to append the three different ctables (which
of course have different info) into my Mtable in my own computer

What is the easiest way of doing this without coding? I need a step by step
help as I am a newbie. Thank you






Michel Walsh said:
Hi,



Can you post what is the SQL view ( the text ) ?


Vanderghast, Access MVP
 
A

Azad

Hi,
This is the SQL Query Text :

UPDATE Disc_Desc SET Disc_Desc.TotMHR = DSum("Mhr","Jobcard","Disc =
""" & "Disc" & """");

Regards
Azad
 
A

Azad

Hi,
This is the SQL Query Text :

UPDATE Disc_Desc SET Disc_Desc.TotMHR = DSum("Mhr","Jobcard","Disc =
""" & "Disc" & """");

Regards
Azad
 
M

Michel Walsh

Hi,


If there is a local network, "split" the application. The idea is to
have the application, on each computer, referring to the same data stored in
one common file on a PC (already open, preferably).

- You can do it without splitting the application too: make the
dot-mdb accessible from the network, on a PC, PCcommon, and have each user
run THAT application with a double click on \\PCcommon\c\...\application.mdb
NOT running a copy of application.mdb on their own PC.


- It is preferable to do it with a database "split". If PCCommon
is the PC that would hold the common data, then, on a PC that is NOT
PCcommon, open a copy of your application (so you can "scrap" it if there is
a problem, that won't hurt, it is just a copy), then, from the menu:
Tools|Database Utilities...|Database Splitter would start a wizard. On
completion, place the backend database on the remote PC that should play the
role of the "file server", PCcommon. Place the front end on your PC. Note
that using the front end, on your PC, should still work without a problem.
Next, copy that front-end application on another PC, and run the application
from that other PC too, it should be without problem either (and faster than
if you did not split the database). If there is a problem to reach the data,
be sure the network share on PCcommon is accessible from the PC you use,
and, if so, and still have the problem, then check it the Tools| Database
Utilities... | Link Tables Manager can see the "back end" PCcommon.
Distribute the front end to each and every one wanting to use the
application. The back end portion of the split should be kept on PCcommon.
If the PC is not a server, remember that the maximum connections to a
non-server share of an Operating System is limited to 10.


- If your PCs are not linked through a local network, you have to
bring the data into a table, say Ctable1, CTable2 and CTable3. You then
open one of them, menu: Edit| Select All (or Ctrl-A), then, open MyTable,
menu: Edit | Paste Append. Repeat for the two other tables. Alternatively,
you can run three queries like:


CurrentDb.Execute "INSERT INTO MTable SELECT * FROM CTable1"


assuming both tables have exactly the same structure.




Hoping it may help,
Vanderghast, Access MVP


L. T. Portella said:
Michel
could you help me with the following which appears to be the simplest
version of an update query.
Thank you for your help

Append query?


1. Using Access 2000
2. Have two tables Mtable and Ctable
3. Both tables have identical fields i.e. name and address
4. Three different people in their own computers input daily info in their
own copy of Ctable
5. At the end of the day I want to append the three different ctables (which
of course have different info) into my Mtable in my own computer

What is the easiest way of doing this without coding? I need a step by step
help as I am a newbie. Thank you
 
M

Michel Walsh

Hi,



Try:


UPDATE Disc_Desc SET Disc_Desc.TotMHR = DSum("Mhr","Jobcard","Disc =
""" & Disc & """");



Hoping it may help,
Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top