Giving Diff Access when Local

I have an app which is based on one server. The users would like to take local replicas - for various reasons I have said it is not a good idea, it uses sequential numbering for one.

They have requested if possible they would take a local replica which would allow them to only view documents, and create new ones which would only be numbered once replicated up to the server (this would be a manual process).

I guess I would have to manually check the copy of the database they are using when trying to edit and allow / reject depending on if it was local or not, I’d do this in script when the doc is opened - any other better ways to handle this?

Jayne

Subject: Giving Diff Access when Local

We have a database like this, and this is how we handle it.

For each “protected” action (including creating certain documents) add

If check_local_copy() Then Exit Sub

Have the following in a script library

(Local_File_Check is in the database profile, so I can deactivate the check on my development/test versions)

Function check_local_copy As Integer

check_local_copy = False



' Only run this if the profile says to 

If Get_Profile_Field( "Local_File_Check" )(0) = "Yes" And db.Server = "" Then

	

	check_local_copy = True

	

	' Warn the user that they cannot do this from this copy

	response = Messagebox ("This action requires that the Server copy of the database be up to date." + Chr(10) + Chr(10)_

	+ "In order to complete this action, this local copy needs to be replicated back to the server, and this action be performed from there." _

	,48, "Server Database Function")

	

End If

End Function

In the Postopen database event

(disable_local_message is in the user’s profile document - they can turn the message off)

' Warn the user that certain actions cannot be done from a local copy

local_check = "Yes"

If doc.Disable_local_message(0) = "Yes" Then local_check = "No"



If local_check = "Yes" And check_local_copy_no_error Then

	response = Messagebox (" This is a Local replica of the database. " + Chr(10) + Chr(10)_

	+ "Certain actions in this database, especially those that effect others, cannot be performed from a local copy."  + Chr(10) + Chr(10)_

	+ "If those actions are selected, a warning will be displayed. You will need to replicate changes from this local copy back to the server, and perform the action from that version."   + Chr(10) + Chr(10)_

	+ "Please refer to the Help documentation for more information."   + Chr(10) + Chr(10)_

	+ "Note : This warning can by turned off in the ""My Profile"" document." _

	,48, "Local Copy Reminder")

End If

Subject: RE: Giving Diff Access when Local

Wow - thanks for posting the code! way more info than I was expecting lol!

Exactley how I was planning unless someone else had a better idea… the profile setting would be usefull… again, Thanks very much!

Jayne