Okay - at least I have a path forward ...
Question: Will this method fix the records with a Primary Key of 9-million something, or will it copy that over, and should I be concerned about that, or should I not worry about it?
I thought about it and I'm really not concerned if the Primary Keys change. It will make my database verification (Excel File Comparison) useless for one cycle, but at long as it doesn't crash before I run one cycle on it ...
I'm thinking the way to do this with the minimal downtime would be:
Manually create the two functions above in the new back end.
Work from a copy/backup of the back end and re-create the table structure in the new back end.
Probably I will work from the previous backup of the back-end and verify everything works - the new back-end would not have today's changes, so I'd want to re-do it on the current file, but at least everyone could keep working while I did my testing. (And I'd have an idea of how long it would take so that I would know how long I needed users to stay out of it).
Get exclusive access to the back end and move the new function there, run the functions, put the new back end in place, and run my Excel exports so I have a baseline.
Let other users back into the database.
To answer some questions and clarify some issues:
And I told you how to do that but you didn't want to follow my directions. IT becomes compliant when you explain the danger of not following the best practice. It is very unlikely that they would give you any grief about forcing the users to have a separate copy of the FE once they understood the problem.
It wasn't an issue of not wanting to follow directions - it was more a matter of deciding it was the right thing to do and how to do it. I used a MORE restrictive approach than you suggested, there are only three folders that the front end will open from (unique to each user, though) and one of them is only on my computer. But I also had to figure out a way to display a message about what folder it needed to be in so that users didn't just complain that it never opened.
It still crashed AFTER I did the issue, so that means that it isn't being caused by multiple users opening the same front end - although that might have previously introduced the corruption that is now going to be repaired.
Recreating the BE is not likely to fix the problem permanently since the problem is more than likely being created by bad code and bad queries or good code and queries running at the wrong time with the wrong arguments.
Okay - somewhat disappointing, but that will be the next issue to face.
For this function, you use the exact table names. I hope they don't contain spaces or special characters. REMEMBER, you MUST import the tables in a logical order if there are any relationships in play. If you don't have any relationships defined (why not???)
Also
@The_Doc_Man - No spaces or special characters, but that was more luck than design. No relationships. More on structure:
This is a database that has been in use since at least 2000. My previous supervisor was bored and decided to learn a bit about Access and build a database for us. It was originally just supposed to create a report automatically and it never did that. I inherited it and with some help from others and a lot of things cobbled together from Google and this forum, it has a lot of useful VBA code. Otherwise (and even with most of the VBA, it's basically Excel with a GUI and a bit more friendly to multiple users at the same time.
There are 8 primary tables and 8 forms that the users see to edit the data in these tables. The remaining tables contain data that are called by the various VBA routines.
There are something like 48 queries, but the queries are basically only used to export the data to various Excel report and the most reliable code I found to export to Excel used queries rather than tables with filters.
There is a LOT of VBA code and the VBA code interacts with Excel, Outlook, Adobe/Kofax PDF, etc. (It used to interact with Word, but we finally phased that out of it.)
If you get an error message regarding a constraint violation, whatever was happening at the time is your culprit for the "#" case and for the "records from a completely different table" case. For the four records that you mentioned in the 3rd bullet, I don't know what to tell you if they are just "missing" since a legit delete might do that, too.
Puzzled here - as I said, it wouldn't necessarily be a constraint violation as I'm seen times that the corrupt records duplicated a primary key. AFAIK, Access isn't supposed to allow you to do that. And the tables have a lot of fields, but each field DOES have a defined type (maybe it has to), but I'm meaning I have date fields and short text and long text fields, etc.
Missing was perhaps an inaccurate term. The could have been overwritten by the records copied from the other table, or they could have been some of the records that were overwritten with "#". I can say with some certainty that it was NOT a legit delete for two reasons. I think I'm the only ones that knows how to delete records from the database. I haven't really publicized that and most of our users aren't likely to research it. The four records that were deleted were all records that I edited earlier in the day yesterday. I didn't intentionally delete them and the odds of another user just happening to delete them is highly remote. I noticed in the past that typically the records that were deleted (or overwritten) were probably records that were open, but I guess that makes sense also.
If the SSN is formatted with dashes, it might be trickier to decode, but if it is raw numbers then a test for numbers might tell you something regarding the input data and stop things when you get input that isn't numbers.
Unfortunately, the SSN example was a bit of subterfuge, there are no SSN numbers in the database. But what I meant was I could tell that somehow it copied the data from Field 4 of Table A into Field 4 of Table B (probably in some cases in violation of constraints - i.e. it might have put text in a date field, etc.)
The first issue will be to "catch the rabbit" because you ain't makin' Hasenpfeffer until you do.
Further tips on how to do that? Would the audit trail mentioned early on in this thread be helpful. (I've never done one, but it seems like possibly a good idea).
***
I'll work on the back end reconversion and let you know how it works out or if I have more issues/questions.
Thanks all!