Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: Simple password

Geek News

Simple password
Frank Situmorang 12/27/2008 2:42:01 PM
Hello,,

After I modified, I used the sample of Access sample switchboard as my menu
in opening my database. Anyone can help me in making a password by just
clicking 1 menu of this. I can make it thru Swithcboard Administrator, by
running a code on it, but I do not know how to make a code so that by
clicking 1 switchboard item, it will shows Message box asking for password.

So the code is more or less is:
If I click 1 menu Then
'Do something

DoCmd.OpenForm "frmManageChurches and Higher Organizations"
Else
MsgBox "You have entered wrong password, please be carefull, password is
case-sensitive"
'Do something else

End If
--
H. Frank Situmorang
Re: Simple password
Rick Brandt <rickbrandt2[ at ]hotmail.com> 12/27/2008 3:14:23 PM
On Sat, 27 Dec 2008 06:42:01 -0800, Frank Situmorang wrote:

[Quoted Text]
> Hello,,
>
> After I modified, I used the sample of Access sample switchboard as my
> menu in opening my database. Anyone can help me in making a password by
> just clicking 1 menu of this. I can make it thru Swithcboard
> Administrator, by running a code on it, but I do not know how to make a
> code so that by clicking 1 switchboard item, it will shows Message box
> asking for password.
>
> So the code is more or less is:
> If I click 1 menu Then
> 'Do something
>
> DoCmd.OpenForm "frmManageChurches and Higher Organizations"
> Else
> MsgBox "You have entered wrong password, please be carefull,
> password is
> case-sensitive"
> 'Do something else
>
> End If

Put the password prompt in the Open event of the form. That way it works
regardless of when/how the form is opened.

If InputBox("Enter Password") <> "YourPassword" Then
MsgBox("Incorrect Password")
Cancel = True
End If

Of course, unless you only give users an MDE then anyone will be able to
see what the password is by looking at your code.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Re: Simple password
Frank Situmorang 12/27/2008 10:39:00 PM
Thanks Rick....It works. Yes I wlll give it in MDE

--
H. Frank Situmorang


"Rick Brandt" wrote:

[Quoted Text]
> On Sat, 27 Dec 2008 06:42:01 -0800, Frank Situmorang wrote:
>
> > Hello,,
> >
> > After I modified, I used the sample of Access sample switchboard as my
> > menu in opening my database. Anyone can help me in making a password by
> > just clicking 1 menu of this. I can make it thru Swithcboard
> > Administrator, by running a code on it, but I do not know how to make a
> > code so that by clicking 1 switchboard item, it will shows Message box
> > asking for password.
> >
> > So the code is more or less is:
> > If I click 1 menu Then
> > 'Do something
> >
> > DoCmd.OpenForm "frmManageChurches and Higher Organizations"
> > Else
> > MsgBox "You have entered wrong password, please be carefull,
> > password is
> > case-sensitive"
> > 'Do something else
> >
> > End If
>
> Put the password prompt in the Open event of the form. That way it works
> regardless of when/how the form is opened.
>
> If InputBox("Enter Password") <> "YourPassword" Then
> MsgBox("Incorrect Password")
> Cancel = True
> End If
>
> Of course, unless you only give users an MDE then anyone will be able to
> see what the password is by looking at your code.
>
> --
> Rick Brandt, Microsoft Access MVP
> Email (as appropriate) to...
> RBrandt at Hunter dot com
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net