Excel to access

javajom

Javajon
Local time
Today, 01:39
Joined
Mar 5, 2008
Messages
37
Hi,
I've just had some help with a spreadsheet security issue and I was wondering how to modify the code for Access? The code is:

PHP:
Private Sub Auto_Open1()
Dim i As Integer
Dim P_Word As String

P_Word = "1968javajon"

If Date <= DateSerial(2008, 8, 30) Then
    Application.ScreenUpdating = False
        For i = 2 To Worksheets.Count
            Worksheets(i).Visible = True
        Next i
    Application.ScreenUpdating = True
    
Else
MsgBox ("Sorry need password, please contact creator")
Application.ScreenUpdating = False
    For i = 2 To Worksheets.Count
        Worksheets(i).Select
            ActiveSheet.Protect Password:=P_Word
    Next i
Application.ScreenUpdating = True

End If
End Sub

Can anybody help?
 
The code posted above can't really be modified for Access. You cannot password protect individual items in Access. You can put a password on the whole database and/or on the visual basic project. You could also use workgroup security in Access 2003 and earlier to limit what users can access/modify by setting up individual/group accounts.
 
date protection

Hi,
what I trying to do is let the database run for 6 months and then be password protected, giving me a chance to do the maintenance on it run queries, append tables and update formulars. I have set the spreadsheet to do the same.

So I need a module to run on start up, compare the date and if true lock off with a password. Please help.
 

Users who are viewing this thread

Back
Top Bottom