Clear Button for Login form

Stella99

New member
Local time
Today, 20:51
Joined
Jan 11, 2016
Messages
3
Hi All,

I have created a login form which contains username and password.

When end user click on "clear" button, it doesn't clear both field.

I have done some research saying

txt_Username.Value = ""
txt_Password.Value = ""

however I am using MS Access 2010 and there is no command set value or etc.

Please help me on this issue

Thanks in advance
 
Can you show us all the code used in the buttons Click event
 
Hi,

Please find attached screenshot. This is how my MS Access look like so I can;'t enter any command like SetValue

Please advise which command should I use for clear button.

Thanks
 

Attachments

  • cmd_clear.png
    cmd_clear.png
    69.9 KB · Views: 117
You try to create a macro now.
If you can, don't use it. The code you got from that research is VBA code.

Best way to do this is go on the form in design mode, select the button 'Clear'. Go to the properties and select the tab Events, there you see all the events you can use. Go to the 'On Click' and add an event Procedure. (from the dropdown menu)
 
Hi Grumm,

I have selected action from command in dropdown menu.

I tried "Redo", "Delete Record", "EditListItem" are not able to clear both field which is username and password

Can please help ?

Appreciate your help, thanks
 
Ok, first, you should see something like this :

pagebreak5.gif


There you select that [event procedure]
Then, you click on the ...
access5.png


It will take you to the vba developping screen. There you can add before the End Sub your code.

You should end with something like this :
Code:
Sub MyButton_Click()
         txt_Username.Value = ""
         txt_Password.Value = ""
End Sub
 

Users who are viewing this thread

Back
Top Bottom