M
Mackster66
MSAccess 2003
Windows XP Pro
Access front end, SQL back end
I have a table "EVMASTER" that contains evidence information. There is a
field "OCA" for the case number for each record. There can be mulitiple
records with the same case number. Each record is assigned an sequential
item number "ITEM" based on "OCA" during entry. Each new "OCA" starts the
count back at 1 for that case number. Other important fields in this table
are "ID" which is an autonumber that is also used for barcoding and
"DESCRIPT" which is a text description of the evidence. New entries are
completed on a form that contains a large amount of VBA.
Problems started occurring when the database was opened to multiple users on
a network. There is a problem with the code where multiple users entering a
large amount of evidence for one case number will cause duplicate item
numbers within that case number. It's not a big deal...it's just confusing
for the attorneys. I'm working on a fix for that, but I also need to go back
and fix the duplicate item numbers.
Can this be done with an update query based on a select query that finds the
duplicates? The select query I'm using to find duplicates is as follows...
SELECT EVMASTER.OCA, EVMASTER.ITEM, EVMASTER.ID, EVMASTER.DESCRIPT
FROM EVMASTER
WHERE (((EVMASTER.ITEM) In (SELECT [ITEM] FROM [EVMASTER] As Tmp GROUP BY
[oca],[item] HAVING Count(*)>1 And [OCA] = [EVMASTER].[OCA])))
ORDER BY EVMASTER.OCA, EVMASTER.ITEM;
Any ideas would be appreciated.
Windows XP Pro
Access front end, SQL back end
I have a table "EVMASTER" that contains evidence information. There is a
field "OCA" for the case number for each record. There can be mulitiple
records with the same case number. Each record is assigned an sequential
item number "ITEM" based on "OCA" during entry. Each new "OCA" starts the
count back at 1 for that case number. Other important fields in this table
are "ID" which is an autonumber that is also used for barcoding and
"DESCRIPT" which is a text description of the evidence. New entries are
completed on a form that contains a large amount of VBA.
Problems started occurring when the database was opened to multiple users on
a network. There is a problem with the code where multiple users entering a
large amount of evidence for one case number will cause duplicate item
numbers within that case number. It's not a big deal...it's just confusing
for the attorneys. I'm working on a fix for that, but I also need to go back
and fix the duplicate item numbers.
Can this be done with an update query based on a select query that finds the
duplicates? The select query I'm using to find duplicates is as follows...
SELECT EVMASTER.OCA, EVMASTER.ITEM, EVMASTER.ID, EVMASTER.DESCRIPT
FROM EVMASTER
WHERE (((EVMASTER.ITEM) In (SELECT [ITEM] FROM [EVMASTER] As Tmp GROUP BY
[oca],[item] HAVING Count(*)>1 And [OCA] = [EVMASTER].[OCA])))
ORDER BY EVMASTER.OCA, EVMASTER.ITEM;
Any ideas would be appreciated.