Grrrr - we are talking about different things and you are abandoning the thread ...
I agree the thread has taken too long and wandered somewhat. Stream of consciousness - it was all loosely related to database corruption.
So if the users don't want to add records, who is doing it?
As I said - legitimate additions 90% of the time, I am. If you mean random records that seem to appear from other tables, I suspect as
@The_Doc_Man theorized, probably cut and paste when DS view was enabled.
It is. If the user can get to the Nav pane and open a table, he can delete/update/insert rows.
Wrong true statement. I have no real doubts about that.
What I meant was that I'm not sure it is a true statement that if I have the nav pane disabled and I have every form set to Allow Deletions = No, this is sufficient and I don't need to add any beforeDelete or BeforeDeleteConfirm code to each form. From what I have been able to tell, though, and from Google, the above seems to be a true statement.
Excel has the provision to lock spreadsheets. This could be how you stop the problem you are having. At the moment you have not clearly identified whether the Access table is getting changed or the spreadsheet. You just know they are different.
Correct observation, but ...
It probably wasn't clear - there are a lot of exports to Excel. The two I've mentioned are:
- Nightly, we do an export to Excel of the table fields. These are shared for other teams in the company to view. They aren't really compared to the database, unless someone sees an obvious error in them.
- I started doing Excel exports to check for added deleted records. This runs weekly and exports 4 or 5 fairly stable fields (the PK and enough other information to identify and find the specific record. Each week, I do a machine comparison between these files. I don't think these files are being tampered with. The time stamps are not changing. My management knows I set them up, but I don't think they know where they are. Nobody other than myself opens them other than me. Correct statement that I don't really see how a record that was in the backup before the previous export, and after the previous export and in the current export is happening. Possibilities:
- Somehow the export skipped one record in one table that night?
- Someone for some reason opened the previous Excel file and deleted that record only - and in that table only.
- Someone deleted the record before the Excel export ran, but after the backup, and then restored the record after the export and before the next backup with the same PK as previously, etc.
None of those seem likely - and many of them don't seem possible.
So, you don't want to implement security or customize menus? You were talking about both earlier. You can roll your own or you can use a concept created by someone else. The security in that version of the switchboards also allows you to customize the switchboards.
I never said I wasn't implementing security. I just haven't fully gotten there yet, and the plan has evolved.
- My original plan was to replace the Navigation Pane with my own custom Navigation Pane and hide the original one, and add additional buttons to the new nav pane for hidden features. There were two ways to do that and neither one of them would work properly for us.
- The first attempt was to create a "switchboard" with a Navigation Group. So the main form would have a subform area and what was FormA would now be shown as SubFormA on the switchboard. Problems with this:
- The main problem was it wouldn't work at different resolutions. With Forms - the status bar is always at the bottom of the form. With this approach, the status bar for the Navigation Pane was always at the bottom of the window, but the status bar might be off the screen. I could probably make it work if everyone ran 1920x1080 at 100% scaling, but I don't even do that on all my screens.
- My FormActivate code never fired - I think b/c it was loading as a subform instead of a main form.
- I wanted to add buttons below the navigation buttons, but there was no way to scale that navigation menu smaller than the subform or to add buttons below the navigation buttons.
- Second approach would have been to go the other direction - i.e. create my switchboard form and add it as a subform to the left of my FormA, FormB, etc. I think this would have worked, but I couldn't minimize to the right the subform (I don't think), like I could with the built-in Nav Pane. (More accurately, I think I could, but I couldn't get the rest of the form controls to shift left with it, so it wouldn't gain me anything.
- I'm ending up using a standard (custom) switchboard form. The Nav Pane and the toolbars/ribbon are both going to be hidden. The shift Key is disabled.
I created my own switchboard rather than modifying the one you (graciously) provided b/c:
- Mainly, I knew how to create it as opposed to learning how to create/modify yours.
- Once I tried your sample database and saw the way the switchboard operates (and @Gasman explained it to me), I knew how the concept of the switchboard worked.
- My switchboard is doing more than just opening forms in the database. It is also (for certain users) running macros/VBA which can't be done after the ribbon is hidden (unless I provided a batch file, etc.). I wanted the buttons color-coded to what their function was. I believe I certainly could have modified your sample switchboard to have additional command functions and to have different colored buttons and resize the buttons, but by the time I did that, it is about the same amount of work either way.