Open a new database from inside access (1 Viewer)

Valentine

Member
Local time
Today, 10:19
Joined
Oct 1, 2021
Messages
261
After some more trial and error and different codes I have found i have a simple problem. When I open the copy I just created that pop up on the top that has the button to click stating "Enable Editing" isnt clicked. So when i try to convert to local it doesnt have permission since it is in a read only copy. Does anyone know how to fix that?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 07:19
Joined
Oct 29, 2018
Messages
21,358
It has the file path starting at C: going to the file name ending with .accdb

Sorry i cant give the actual path its a secure system
That makes it hard to help you troubleshoot it though. Are you sure it doesn't have any illegal characters, for example?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 07:19
Joined
Oct 29, 2018
Messages
21,358
After some more trial and error and different codes I have found i have a simple problem. When I open the copy I just created that pop up on the top that has the button to click stating "Enable Editing" isnt clicked. So when i try to convert to local it doesnt have permission since it is in a read only copy. Does anyone know how to fix that?
Easy! Can you set the backup folder as a Trusted Location?
 

Valentine

Member
Local time
Today, 10:19
Joined
Oct 1, 2021
Messages
261
Nope, apparently that is against ARMY policy.........I think I am going to have to make this a 2 part thing, first button creates copies and then you have to go into the unlinked copy an hit the unlink button to unlink all the tables. Unless there is another way to create an editable copy from code.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 07:19
Joined
Oct 29, 2018
Messages
21,358
Nope, apparently that is against ARMY policy.........I think I am going to have to make this a 2 part thing, first button creates copies and then you have to go into the unlinked copy an hit the unlink button to unlink all the tables. Unless there is another way to create an editable copy from code.
Hi. As I mentioned in post #18, there are several possible approaches to get to the same end result. What you're proposing now is one of them. I would agree that it's worth trying out. Let us know if the code works once you have moved it to the backup copy, and we'll help you automate that part then. Good luck!
 

theDBguy

I’m here to help
Staff member
Local time
Today, 07:19
Joined
Oct 29, 2018
Messages
21,358
Nope, apparently that is against ARMY policy.........I think I am going to have to make this a 2 part thing, first button creates copies and then you have to go into the unlinked copy an hit the unlink button to unlink all the tables. Unless there is another way to create an editable copy from code.
By the way, the code I gave you was developed and tested within the NMCI network. The SharePoint site is hosted by DISA. Just letting you know...
 

theDBguy

I’m here to help
Staff member
Local time
Today, 07:19
Joined
Oct 29, 2018
Messages
21,358
Hi. As I mentioned in post #18, there are several possible approaches to get to the same end result. What you're proposing now is one of them. I would agree that it's worth trying out. Let us know if the code works once you have moved it to the backup copy, and we'll help you automate that part then. Good luck!
Just FYI, here's what the code might look like when ran from within the backup file.
Code:
Public Function SP2Local() As Boolean
'thedbguy@gmail.com
'10/29/2021
'converts SharePoint linked tables to local tables

Dim db As DAO.Database
Dim tdf As DAO.TableDef

Set db = CurrentDb()

For Each tdf In db.TableDefs
    With tdf
        If InStr(.Connect, "ACEWSS") > 0 Then
            DoCmd.SelectObject acTable, .Name, True
            DoCmd.RunCommand acCmdConvertLinkedTableToLocal
           
        End If
    End With
Next

MsgBox "All done!", vbInformation, "Info"

Set tdf = Nothing
Set db = Nothing

End Function
Hope that helps...
 

Valentine

Member
Local time
Today, 10:19
Joined
Oct 1, 2021
Messages
261
Thank you for all the help. Took me all week to realize that I couldn't do it in 1 button and only 15 min to actually create both buttons and have it working.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 07:19
Joined
Oct 29, 2018
Messages
21,358
Thank you for all the help. Took me all week to realize that I couldn't do it in 1 button and only 15 min to actually create both buttons and have it working.
Congratulations! You might consider sharing your solution in case it might help others with the same need in the future.

Good luck with your project.
 

Users who are viewing this thread

Top Bottom