Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Microsoft Access > Re: Help with s...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 16 of 16 Topic 30170 of 31596
Post > Topic >>

Re: Help with some VB Code

by colemanj4 <colemanj4@[EMAIL PROTECTED] > May 7, 2008 at 11:12 AM

On May 6, 9:56=A0pm, "Albert D. Kallal" <PleaseNOOOsPAMmkal...@[EMAIL PROTECTED]
>
wrote:
> Actually, I have to run right now...but, let me take a look at this
later
> tonight....
>
> I do think something can be cooked up here.....
>
> --
> Albert D. Kallal =A0 =A0(Access MVP)
> Edmonton, Alberta Canada
> pleaseNOOSpamKal...@[EMAIL PROTECTED]
 is what I have now, I have defined the function
'NetworkUserName' to return the login name of the user. I want (where
the comments are) to change their user type (as defined in the *.ldb)
to be User instead of Admin, as User only has read only access to the
DB.

Been searching how to do that and can't find it, any help you could
provide would be awesome.


Sub LockDB()

    Dim Show_Box As Boolean
    Dim Response As String
    Dim userName As String

    userName =3D NetworkUserName()

    Show_Box =3D True

    While Show_Box =3D True

        Response =3D InputBox("Enter the Password for Admin. Cancel to
Enter as Read-Only", _
            "Read-Only Unlocking")

        'See if Cancel was pressed.
        If Response =3D "" Then

            'Set userName to the User group HERE
            MsgBox "You can look at anything, but change nothing"
            Show_Box =3D False


        Else
            'Test Entry to find out if it is the correct password.
            If ("safety" =3D Response) Then

                MsgBox "You are granted Admin rights"
                'set userName to the Admin group HERE
                Show_Box =3D False

            Else

                ' If the entry was wrong, show an error message.
                MsgBox "Wrong Password, Try again."

            End If
        End If
      Wend

End Sub

Thanks
 




 16 Posts in Topic:
Help with some VB Code
colemanj4 <colemanj4@[  2008-05-05 12:07:44 
Re: Help with some VB Code
Rich P <rpng123@[EMAIL  2008-05-05 18:04:44 
Re: Help with some VB Code
"Albert D. Kallal&qu  2008-05-06 06:00:43 
Re: Help with some VB Code
Tom van Stiphout <no.s  2008-05-06 06:54:15 
Re: Help with some VB Code
Rich P <rpng123@[EMAIL  2008-05-06 10:17:49 
Re: Help with some VB Code
Rich P <rpng123@[EMAIL  2008-05-06 11:37:35 
Re: Help with some VB Code
"Albert D. Kallal&qu  2008-05-07 01:51:06 
Re: Help with some VB Code
Rich P <rpng123@[EMAIL  2008-05-07 10:32:35 
Re: Help with some VB Code
colemanj4 <colemanj4@[  2008-05-06 05:34:46 
Re: Help with some VB Code
"Albert D. Kallal&qu  2008-05-07 01:56:43 
Re: Help with some VB Code
Element <mhammer@[EMAI  2008-05-06 05:38:35 
Re: Help with some VB Code
lyle fairfield <lyle.f  2008-05-07 03:47:15 
Re: Help with some VB Code
lyle fairfield <lylefa  2008-05-07 11:01:31 
Re: Help with some VB Code
colemanj4 <colemanj4@[  2008-05-07 06:10:11 
Re: Help with some VB Code
lyle fairfield <lylefa  2008-05-07 13:29:24 
Re: Help with some VB Code
colemanj4 <colemanj4@[  2008-05-07 11:12:15 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Dec 5 11:29:36 CST 2008.