Try this:
- Open the database and Press Ctrl+G. This will open the immediate window.
2. In the window enter the following and then press the Return key:
? Currentdb.Name
3. You should then see something like the following, which shows the path to my Accounts.accdb database, which is the front end file for my personal accounts:
C:\Users\kenws\Documents\Databases\Finance\Accounts.accdb
- Next enter the following in the window: ? Currentdb.TableDefs(0).Connect
This shows the path to my back end database, which contains the tables which the front end connects to. In this case the back end is in the same folder as the front end, but that need not be the case; it could be in a different folder:
;DATABASE=C:\Users\kenws\Documents\Databases\Finance\Accounts_be.accd
5. Close the database, and in File Explorer browse to the front end file at the location shown above. In your case, from what you've said earlier, this will be in OneDrive. Open another instance of Windows Explorer in another window, and browse to the local folder on your PC where you want the database to be located. You can create a new folder if necessary. Click and drag the front end file from the first Explorer window into the local folder in the other window.
6. Repeat step 5 for the backend file, moving it to a local folder.
7. Having moved the files you will now need to refresh the links in the front end file, so that they connect to the back end in its new location, so firstly open the front end, while holding down the Shift key. This will bypass any start up routines in the front end, so you won't get any error which would occur if, for instance, at start-up, the front end opens a form whose RecordSource is a table linked to the back end.
8. In the front end select the External Data ribbon.
9. In the ribbon select Linked Table Manager in the Import & Link area of the ribbon.
10. In the Linked Table Manager click on the Select All button and then the Relink button. This will open the file dialogue in which you can browse to the back end file in its new location to which you moved it. You'll probably find that the dialogue is currently showing folders in OneDrive, so be sure you browse to the local folder. I usually start with OS(C:) and then drill down through Users, kenws (my user name), etc until I get to the right folder. Select the file and then click the Open button in the dialogue to relink the tables.
Having successfully moved and relinked the files, if you want to make any changes to table designs, e.g. adding a new field, you should open the back end file and make the changes there. If you want to change the design of any other objects, e.g. forms, reports or queries, these should be made in the front end. In the normal operation of the database you'd open the front end, in which you can enter or edit data in bound forms, retrieve data via queries, or open reports.
Note that, if you are operating in a multi-user environment on a wired local area network, separate copies of the front end can be installed on multiple users local machines, enabling those users to use the database concurrently, in each case linked to the same back end. Do not install a single copy of the front end in a shared location on the network, however. Having multiple users open the same copy of the front end concurrently is very likely to corrupt the database.
Finally, and this cannot be over-stated, it is vitally important that you store at least one backup copy of the front end in a secure location independent of the operational front end(s), and, even more importantly, that you create regular backups of the back end file. I would strongly recommend that you maintain at least two backups of the back end, e.g. one on a local external or removable medium, and one in the cloud, e.g. in a OneDrive folder or similar. Also I'd recommend that you make dated backups, so that, if the latest backup(s) become corrupted, you can revert to an earlier intact backup, thus minimizing data loss.