Password VBA To Open A Linked form?

CarolW

Registered User.
Local time
Today, 03:59
Joined
Mar 24, 2006
Messages
58
Hello everybody,
Can anyone please help me? I’ve been wandering around the various forums
trying to gain some advice concerning password protecting a form. I have tried in vain to tackle this one on my own but alas I cannot, and hence I am turning to some kind person out there to try to help me out of my problem.

Having searched the various forums extensively, and have seen numerous examples all of which work fine but I cannot for the life of me understand where I could incorporate such code along with the existing code that I already use, with great success to open a linked form. All I want to achieve is for a user to click on a command button and for it to prompt for a password and then to open up my form which is synchronised to the original form that contains the command button.

What I have so far is:

Private Sub Command146_Click()
On Error GoTo Err_Command146_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "RestrictedAccess"

stLinkCriteria = "[Medical.Release No]=" & "'" & Me![PatientNumber] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command146_Click:
Exit Sub

Err_Command146_Click:
MsgBox Err.Description
Resume Exit_Command146_Click

End Sub



I read the following thread from Ghudson showing a good example of password protecting a form but how do I use such code in the example that I have above.

http://www.access-programmers.co.uk/forums/showthread.php?t=85846


Any help that could be provided would be very much appreciated.
P.S: This site has been invaluable to me in the past, particularly as I am a relative newcomer to Access and VBA.

Best Regards

CarolW:
 

Users who are viewing this thread

Back
Top Bottom