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

Problem appending to table with autonumber primary keys Allen Browne's Audit Trail

14
I have a main form (mainformlung) with 5 subforms (followupacute, followuplate, biochemresults, haemresults and pftresults). I have copied Allen Browne's Audit Trail code (thanks to Allen Browne) and this is working great, edit, insert etc is working bar when I try to delete a record in one of my subforms (I'm in test stage at the mo) I get a run time error 3022 'The changes you requested to the table where not successful because they would create duplicate values in the index, primary key or relationship, change the data in the field or fields and that contain duplicate data, remove the index or re define the index to permit duplicate entries and try again'. As I am sure you are all aware you have to use an index primary key field with Allen Brownes Audit Trail. When I delete the record it is written into the temporary audit table but can't be written into the 'permanent' audTable as there is already the same autonumber index causing duplication. Has anyone had a similar problem and can anyone suggest a fix, I've looked at Allen Browne's tips and bugs section to see if I can get a fix but I can see nothing obvious. I'm sorry if there is a very simple way to do this but i'm in brain freeze at the minute!

Thanks in advance experts!

PS. I'm using Access 2000.
Jun 18 '08 #1
6 2705
FishVal
2,653 Expert 2GB
Hello.

I guess it is designed to work with single table audit.
For multiple tables you may create multiple audit tables or store table PK in non-indexed field of single audit table - sure you need an additional field to detect which table record is stored.
Or, what makes more sense - merge multiple "results" table to one. Do you have any special reason(s) to store data in multiple tables while it does fit the structure of single audit table?

Kind regards,
Fish
Jun 18 '08 #2
babamc4
14
Hello.

I guess it is designed to work with single table audit.
For multiple tables you may create multiple audit tables or store table PK in non-indexed field of single audit table - sure you need an additional field to detect which table record is stored.
Or, what makes more sense - merge multiple "results" table to one. Do you have any special reason(s) to store data in multiple tables while it does fit the structure of single audit table?

Kind regards,
Fish
Hi Fish

Thanks for replying. Unfortunately I had made just a little mistake (doh!) and I should not have put in a primary key autonumber in the temp audit table, sorry for that. With regards to your question re storing data in multiple tables as opposed to just one, I am not entirely sure what you mean here. I have just followed the way my DB is set up (ie one to many) is this what you mean?

Thanks
Aine
Jun 18 '08 #3
FishVal
2,653 Expert 2GB
... With regards to your question re storing data in multiple tables as opposed to just one, I am not entirely sure what you mean here...
I just guessed that as soon as you store deleted records from multiple tables in a single audit table they may have the same set of fields. If so, then the tables may be advantageously merged into a single one following database normalization rules.

Regards,
Fish
Jun 18 '08 #4
babamc4
14
I just guessed that as soon as you store deleted records from multiple tables in a single audit table they may have the same set of fields. If so, then the tables may be advantageously merged into a single one following database normalization rules.

Regards,
Fish
Hi Fish,

Thanks I had a look at that article that you sent. Yes you are quite correct re normalisation and my DBs are normalised (to the 3NF level), but if I was to merge into one table (which I will honestly say I don't know how to do in VBA) they will be extremely large and not very easy to read look at. My audit tables will be monitored by organisations (such as the FDA if you are from the states) and while it may be a good idea to 'hide' things (lol!) in the data it would be inappropriate for me to present them with large tables and/or reports. Does the fact that I have multiply audit tables (which still comply with 1 to many rule) mean that my DBs are no longer normalised?

Many thanks
Baba
Jun 19 '08 #5
FishVal
2,653 Expert 2GB
Hello, Baba.
  • I suggest you to post results tables metadata to make our conversation more substantial.Here is an example of how to post table MetaData :
    Table Name=tblStudent
    Expand|Select|Wrap|Line Numbers
    1. Field; Type; IndexInfo
    2. StudentID; AutoNumber; PK
    3. Family; String; FK
    4. Name; String
    5. University; String; FK
    6. Mark; Numeric
    7. LastAttendance; Date/Time
  • In general tables are not supposed to be "easy to read" - this is what queries/forms/reports, in one word user interface, are for.
  • Performance may be a reason to store identically structured records in different tables. Is this your case?
  • As far as I know, software has to be validated to satisfy FDA inspection. The issue seems to be interesting. If you have certain knowledge about it, then I would be glad to receive any links from you.

Regards,
Fish
Jun 20 '08 #6
babamc4
14
Hello, Baba.
  • I suggest you to post results tables metadata to make our conversation more substantial.Here is an example of how to post table MetaData :
    Table Name=tblStudent
    Expand|Select|Wrap|Line Numbers
    1. Field; Type; IndexInfo
    2. StudentID; AutoNumber; PK
    3. Family; String; FK
    4. Name; String
    5. University; String; FK
    6. Mark; Numeric
    7. LastAttendance; Date/Time
  • In general tables are not supposed to be "easy to read" - this is what queries/forms/reports, in one word user interface, are for.
  • Performance may be a reason to store identically structured records in different tables. Is this your case?
  • As far as I know, software has to be validated to satisfy FDA inspection. The issue seems to be interesting. If you have certain knowledge about it, then I would be glad to receive any links from you.

Regards,
Fish
Hi Fish,

Sorry for the delay in getting back to you, I have been working on another project that was given to me at the last minute so I've been very busy.

I agree with what you are saying re tables not being easy to read and I would like to give a report on what is in the table but unfortunately they will need to see the tables etc to ensure that there is no tampering (by me!).

I suppose that I try to keep certain data items in 'one box' so to say, such as biochemistry results seperate from the radiotherapy details, therefore the original tables are not related so I don't think I can have the audit tables combined into 1, but please correct me if I am wrong I am only doing this for 1.5yrs.

With regards to the FDA requirements and legislation, the catchall legislation being FDA, 21 CFR Part 11, http://www.fda.gov/ora/compliance_re.../ffinalcct.pdfthere is also the International Council of Harmonisation and Good Clinical Practive (ICH GCP) legislation http://www.emea.europa.eu/pdfs/human/ich/013595en.pdf The EU Directive, and our local legislation Control of Clinical Trials Act, (Ireland), so you can see we work in a very tightly regulated area and in as such you have to 'prove' that you aren't doing anything wrong as opposed to the assumption that there is nothing wrong.
The FDA themselves do not come over from the US and audit us, but do ask that our local regulatory bodies use their legislation if the trial orgininated in the US. I apologise if I have rambled on but it is not an easy topic to write about in a few short paragraphs. I have had to extensivily research all the legislations and condense into a report for my bosses even so the document was 6 pages long!

Before I start writing down all the table and field names, which ones (ie audit) tables are you interested.

Again many thanks for all your help and expertise.

Baba
Jul 1 '08 #7

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

Similar topics

4
by: Fred | last post by:
Hi. What is the usual and what are the possible fields to use for the primary key of an intersecting table of a many-to-many relationship? I would think the typical, most common fields would...
11
by: John Baker | last post by:
Hi: I have a table which is indexed on an auto number (supposedly unique for each record). For reasons I cannot explain, I have started to encounter a problem with duplicate auto numbers. The...
3
by: Ralph Birden | last post by:
Hi all, Here's my situation: I have 2 tables, let's call them TableA and TableB. TableA has a primary key called AffNo, TableB's primary key (--> foreign key in TableA) is called ID, and is...
4
by: Bradley Burton | last post by:
I'm using Allen Brown's code for audit logging (http://allenbrowne.com/AppAudit.html), but I'm having a problem. My aud table doesn't populate with the tracking info at all. I think it might be a...
4
by: dhcomcast | last post by:
We're starting to use Oracle for the back-end instead of a separate Access .mdb file for the data and everything as gone surprisingly well so far. We are learning Oracle as we go; Yikes! But we...
7
by: manning_news | last post by:
I've got a report that's not sorting correctly. I build a SQL statement and assign it to the recordsource in the Open event, sorting the data the way the user chooses. The user can choose up to 3...
3
by: VMI | last post by:
How can I get the bottom N records from an Access table and store them in my DataTable? For example, in my Access table with 2000 records, if I want to display records 151-200 (with ID as PK), my...
6
by: philmgron | last post by:
Hello I have been hitting my head against the wall on this problem for a day now. I have a simple table that stores cities, on of the fields on the table is modified_by. I am trying to write the...
9
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform has the child link to the main form identity key. subform1 - Master Field: SK Child Field: TrainingMasterSK The second subform has a...
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?
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.