do while statement with input box response
Posted on 2001-06-28
I am relatively new to this Access programming game so this question may seem a little basic to you smart guys (and girls) out there. My problem is this:
I have a database form containing a command button. it's on click function deletes the contents of redundant fields on that forms, allowing for fresh data to be entered. This I can code no problem. What I can't seem to remember how to do from an old VB course I did last year is code using the do while statement. This is how I wish to use it.
1.User clicks delete button and is prompted for a password (password is entered into an inputbox)
2.If password is correct (password is built into the code itself and is not linked to any table) content of fields are deleted.
3.If password is wrong, a msbox will inform user they have entered an incorrect password and give them the option to either try again or quit. They can only have three attempts at getting the password correct.
4.If they get password wrong 3 times they get a msgbox telling them this. The application will then close.
I have tried various ways of doing this without success, the help on Access is no use and the reference book I have does not provide adequate instruction.
Can anyone help?