Thank you, went a slightly different way but the Sql and the Autonumber hint was essential for my brain to kick in
Sub RemoveTBDuplicates(strTablename As String)
Dim db As Database
Dim rst, rst2 As Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset(strTablename)
Set rst2 =...
I have a table with duplicate records but also semi duplicate records.
SpNo SpDate DateAuth Result CulComment
B1445677 15/06/2020 26/06/2020 NO res myo comm
B1445677 15/06/2020 26/06/2020 -------- myo comm...
This seems to solve the problem. Slight change in approach as any records in input table will always be the most up to date so I only need to remove the records from the destination table with the same spnumber. Can anyone see any potential issues or cleaner code. "I will add error code after"...
I need to compare a small source table (upto 100 records) with a much larger destination table (20000).
If the ID is the same I need to delete any records (there may be more than one) that are older in the destination table. It doesn't matter if the other fields differ as the newer records...
This problem is more about getting the data in from multiple automated inputs into a flat file table which will be the source file for another system.
Sent from my iPhone using Tapatalk
The following is in no way meant to be or sound condescending
Ok to explain a little more. The original record could output one line or more depending on current results for specimen as the output delivers 2 lines if 2 comments are added.
This could then change to no result eg only 1 line...
I do understand where you are coming from however the problem is they are not true duplicates as the later records will be an updated version but the original record is required to ensure tests are in the system. Only a few fields will be identical and I need to be able to remove the old ones...
I have 31 tables which as they are updated are appended to the Master table (bad name should call holding but for this example I called it Master).
The Master Table could have upwards of 5000 records depending on when it is updated. I need to remove the duplicates before moving the data to...
You both gave very valid answers and I was just being stupid I couldn't get my result field to diplay the sensitivity but just a number. Might have helped if I had used "First" rather than Sum or count.
Thank you
I always try to make things more complicated than they are.
I have an excel spreadsheet (example attached) which is populated by lab equipment. The key field is the specimen number and specimen type. Currently for every antibiotic there is a row with its result. My output is 3 complete worksheets so a lot of data. I need to create a database with one row...
This is probably dead simple, I have always been used to writing vba for Access Xp (haven't done so for a few years) etc where
Dim db as database
Dim rs as recordset
Set db = Currentdb
Set rs = db.CreateTableDef (sorry your correct)
etc
etc
but I cannot seem to do this anymore in...
Thanks for your prompt reply however what I am really after is how in vba would I capture the print command being used on this report / query as people are likely to view the query often but only print once a month. Hope that makes more sense. Once the print command is used in relation to this...