how to lock folder

sandy70

Registered User.
Local time
Yesterday, 21:11
Joined
Apr 16, 2008
Messages
41
hi guys ,
my friends ask me to make a folder base on invoice number so they can put some picture on it

i already make it ( attached ):)

but one more problem , they ask me to lock the folder so only related invoice number can be open :confused:
So invoice number 001 can only open folder no 001

any idea how to make it ???
 

Attachments

http://www.access-programmers.co.uk/forums/showthread.php?t=215253
Not your exact solution, just related to the folder rights.
Protection at the Network level is something for the network administator to do.
For example: My network admin created a Folder D:\Data that just select users can view. My Access program allows users to create sub-folders in the secured D:\Data directory. Nobody outside the users assigned by the network administrator can access the folders.
My folder creations have several levels (e.g. Admin, Supervisors, Managers, Compliance, Public, ...)
The Access user can be determined. With logic, a report can be presented to each level of users. The resulting report can be saved in the different folder level, only availabe to the group that shoud view it.
It is the Network Administrator who determines who has access to view the different levels of folders.

What are you putting into the folder?
For example: if the data is put into the folder is an Excel Worksheet, the Excel worksheet might have a password added to it.

Just be aware: The security in Excel can easily be cracked by programmers. It is to prevent the casual observer from opening. It is not really all that secure.

Code:
[COLOR=#0000ff]Dim[/COLOR] ws [COLOR=#0000ff]As[/COLOR] Worksheet 
[COLOR=#0000ff]Sub[/COLOR] ProtectAll() 
    [COLOR=#0000ff]Dim[/COLOR] S [COLOR=#0000ff]As[/COLOR] [COLOR=#0000ff]Object[/COLOR] 
    [COLOR=#0000ff]Dim[/COLOR] pWord1 [COLOR=#0000ff]As[/COLOR] [COLOR=#0000ff]String[/COLOR], pWord2 [COLOR=#0000ff]As[/COLOR] [COLOR=#0000ff]String[/COLOR] 
    pWord1 = InputBox("Please Enter the password") 
    [COLOR=#0000ff]If[/COLOR] pWord1 = "" [COLOR=#0000ff]Then[/COLOR] Exit [COLOR=#0000ff]Sub[/COLOR] 
    pWord2 = InputBox("Please re-enter the password") 
     
    [COLOR=#0000ff]If[/COLOR] pWord2 = "" [COLOR=#0000ff]Then[/COLOR] Exit [COLOR=#0000ff]Sub[/COLOR] 
     [COLOR=#006400]'make certain passwords are identical[/COLOR]
    [COLOR=#0000ff]If[/COLOR] InStr(1, pWord2, pWord1, 0) = 0 [COLOR=#0000ff]Or[/COLOR] _ 
    InStr(1, pWord1, pWord2, 0) = 0 [COLOR=#0000ff]Then[/COLOR] 
        MsgBox "You entered different passwords. No action taken" 
        Exit [COLOR=#0000ff]Sub[/COLOR] 
    [COLOR=#0000ff]End[/COLOR] [COLOR=#0000ff]If[/COLOR] 
    [COLOR=#0000ff]For Each[/COLOR] ws [COLOR=#0000ff]In[/COLOR] Worksheets 
        ws.Protect Password:=pWord1 
    [COLOR=#0000ff]Next[/COLOR] 
    MsgBox "All sheets Protected." 
    Exit [COLOR=#0000ff]Sub[/COLOR]    
[COLOR=#0000ff]End Sub[/COLOR] 
 
[COLOR=#0000ff]Sub[/COLOR] UnProtectAll() 
    [COLOR=#0000ff]Dim[/COLOR] S [COLOR=#0000ff]As[/COLOR] [COLOR=#0000ff]Object[/COLOR] 
    [COLOR=#0000ff]Dim[/COLOR] pWord3 [COLOR=#0000ff]As[/COLOR] [COLOR=#0000ff]String[/COLOR] 
    pWord3 = InputBox("Please Enter the password") 
    [COLOR=#0000ff]If[/COLOR] pWord3 = "" [COLOR=#0000ff]Then[/COLOR] Exit [COLOR=#0000ff]Sub[/COLOR] 
    [COLOR=#0000ff]For Each[/COLOR] ws [COLOR=#0000ff]In[/COLOR] Worksheets 
        [COLOR=#0000ff]On Error Goto[/COLOR] errorTrap1 
        ws.Unprotect Password:=pWord3 
    [COLOR=#0000ff]Next[/COLOR] 
    MsgBox "All sheets UnProtected." 
    Exit [COLOR=#0000ff]Sub[/COLOR] 
     
errorTrap1: 
    MsgBox "Sheets could not be UnProtected - Password Incorrect" 
    Exit [COLOR=#0000ff]Sub[/COLOR]     
[COLOR=#0000ff]End Sub[/COLOR] 
 
[COLOR=#0000ff]Sub[/COLOR] ProtectWorkbook() 
    [COLOR=#0000ff]Dim[/COLOR] S [COLOR=#0000ff]As[/COLOR] [COLOR=#0000ff]Object[/COLOR] 
    [COLOR=#0000ff]Dim[/COLOR] pWord3 [COLOR=#0000ff]As[/COLOR] [COLOR=#0000ff]String[/COLOR], ShtName [COLOR=#0000ff]As[/COLOR] [COLOR=#0000ff]String[/COLOR] 
    pWord5 = InputBox("Please Enter the password") 
    [COLOR=#0000ff]If[/COLOR] pWord5 = "" [COLOR=#0000ff]Then[/COLOR] Exit [COLOR=#0000ff]Sub[/COLOR] 
    ShtName = "Workbook as a whole" 
    [COLOR=#0000ff]On Error Goto[/COLOR] errorTrap1 
    ActiveWorkbook.Protect Structure:=[COLOR=#0000ff]True[/COLOR], Windows:=[COLOR=#0000ff]False[/COLOR], Password:=pWord5 
    MsgBox "The workbook's structure has been protected." 
    Exit [COLOR=#0000ff]Sub[/COLOR]      
errorTrap1: 
    MsgBox "Workbook could not be Protected" 
    Exit [COLOR=#0000ff]Sub[/COLOR]      
[COLOR=#0000ff]End Sub[/COLOR] 
 
[COLOR=#0000ff]Sub[/COLOR] UnProtectWorkbook() 
    [COLOR=#0000ff]Dim[/COLOR] S [COLOR=#0000ff]As[/COLOR] [COLOR=#0000ff]Object[/COLOR] 
    [COLOR=#0000ff]Dim[/COLOR] pWord3 [COLOR=#0000ff]As[/COLOR] [COLOR=#0000ff]String[/COLOR], ShtName [COLOR=#0000ff]As[/COLOR] [COLOR=#0000ff]String[/COLOR] 
    pWord5 = InputBox("Please Enter the password") 
    [COLOR=#0000ff]If[/COLOR] pWord5 = "" [COLOR=#0000ff]Then[/COLOR] Exit [COLOR=#0000ff]Sub[/COLOR] 
    ShtName = "Workbook as a whole" 
    [COLOR=#0000ff]On Error Goto[/COLOR] errorTrap1 
    ActiveWorkbook.Unprotect Password:=pWord5 
    MsgBox "The workbook's structure has been Unprotected." 
    Exit [COLOR=#0000ff]Sub[/COLOR]      
errorTrap1: 
    MsgBox "Workbook could not be UnProtected - Password Incorrect" 
    Exit [COLOR=#0000ff]Sub[/COLOR]      
[COLOR=#0000ff]End Sub[/COLOR]
 

Users who are viewing this thread

Back
Top Bottom