Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

give user 3 attempts to get text right or close access 1

Status
Not open for further replies.

bened

Technical User
Aug 30, 2000
1
NZ
tried before to post this but didn't seem to come up so here goes again........

i'm making my own 'enter password' type form and i want it to work so that if the user gets the password wrong three times then access closes down.
i'm stuck on how i get access to count the attempts. i'm guessing this is done using VB?
please help

 
How are you testing for a correct password, and what are you doing if it is correct. Do you have any code on the password field, or button now, if so paste it here. That will help us get an accurate response. What you are requesting is definitely possible, just need some details.

Thanks
 
Hi Bened

yes you could use vb for that,

attempt entering the p/w 3 times.

"password" and "thepassword" are data items you need to supply.

'form scope global
form declaration

dim myCounter as integer


in the forms onopen event add

myCounter = 2

you'll also need a button or something for the user to
acknowledge the password "entry"

add this to the "Entry" button on_click event.

dim aPassword as variant
dim testPassword as variant

'check p/w add your control names
testPassword = me."password"
aPassword = "thepassword"

if (StrComp(aPassword, testPassword ,0) = 0) then
' third argument 0 = case sensitive
' 1 = text match only
' what ever code to allow user to continue
' open main form etc.
else
msgbox "invalid password"
if myCounter = 0 then
Application.Quit
end if
myCounter = myCounter -1
end if

<something like that>

that should get you started :)
after you get going...you can add user name etc

make the form modal in the forms/other/modal->yes
and forms/format/borderstyle->dialog
and remove the &quot;control box&quot; and &quot;close&quot; options
this isn't nasa strength password checking...
the user can still access access!

see ya
RobertD
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top