On May 5, 3:07=A0pm, colemanj4 <colema...@[EMAIL PROTECTED]
> wrote:
> Here is what I have so far, it loops while the PW is incorrect, or
> until cancel is selected. I want it to lock the tables for adds,
> deletes, and edits when cancel is selected, and if the PW is correct.
>
> I want this to run when the DB is opened, I would also like the text
> box to be starred (*) out when text is input.
>
> Thanks for your help.
>
>
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D
> =A0Dim Show_Box As Boolean
> =A0 =A0 Dim Response As String
>
> =A0 =A0 ' Set the Show_Dialog variable to True.
> =A0 =A0 Show_Box =3D True
> InputBox
> =A0 =A0 ' Begin While loop.
> =A0 =A0 While Show_Box =3D True
>
> =A0 =A0 =A0 =A0 ' Show the input box.
> =A0 =A0 =A0 =A0 Response =3D InputBox("Enter the Password to Unlock
Read-O=
nly
> Mode.", _
> =A0 =A0 =A0 =A0 =A0 =A0 "Read-Only Unlocking")
> =A0 =A0 =A0 =A0 ' See if Cancel was pressed.
> =A0 =A0 =A0 =A0 If Response =3D "" Then
>
> =A0 =A0 =A0 =A0 =A0 =A0 ' If Cancel was pressed,
> =A0 =A0 =A0 =A0 =A0 =A0 ' break out of the loop.
> =A0 =A0 =A0 =A0 =A0 =A0 Show_Box =3D False
>
> =A0 =A0 =A0 =A0 Else
> =A0 =A0 =A0 =A0 =A0 =A0 ' Test Entry to find out if it is the correct
pass=
word.
> =A0 =A0 =A0 =A0 =A0 =A0 If "safety" =3D Response =3D True Then
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 'Application.CloseCurrentDatabase
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 'Application.DBEngine.OpenDatabase
"P:\ACT=
ION REGISTER
> \TESTERIncidet Action Register Database.mdb", , True
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 'Application.OpenCurrentDatabase
"P:\ACTIO=
N REGISTER
> \TESTERIncidet Action Register Database.mdb", False
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 'Access.AcOpenDataMode.acReadOnly
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Show_Box =3D False
> =A0 =A0 =A0 =A0 =A0 =A0 Else
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ' If the entry was wrong, show an error
me=
ssage.
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 MsgBox "Wrong Password, Try again."
> =A0 =A0 =A0 =A0 =A0 =A0 End If
> =A0 =A0 =A0 =A0 End If
> =A0 =A0 =A0 ' End the While loop.
> =A0 =A0 =A0 Wend
>
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
OK, since what I want to do doesn't seem possible, is there a way I
could set the current user to user level access instead of admin? I
don't want ot get into doing all of the security wizard access has, as
I have tried it multiple times and it is not working. I believe that
is because of the way my cor****ate IT has the permissions set up for
the whole network, and they are a pain to get involved with.
So... say doej is the user, he opens up the DB, and is asked for a
password, he hits cancel and I then want to delegate him to the "User
group" which only has readonly access. Can I do this with my VBA
code?
Thanks


|