when i open the form,as i dun wan user to be able to enter anything at first i disable the button.i wan to enable the buttons after i click on a button.how can i do it???can u guys pls help...thanks!
Don't disable the button using it's right click enabled property, make sure it is enabled. Instead on the FORM Open event, put an Event procedure:
Private Sub Form_Open(Cancel As Integer)
Me.button1.enabled = false
End Sub
Then using the ON CLICK event for the second button put in another event procedure stating ME.Button1.enabled = true
So your second button ON CLick event procedure should look like this:
Private Sub button2_Click()
On Error GoTo Err_button2_Click
me.button1.enabled = true
Exit_button2_Click:
Exit Sub
Err_button2_Click:
MsgBox Error$
Resume Exit_button2_Click
End Sub
Even better, if you want the button1 to be disabled for all records in the form until button2 is clicked each time then move the Me.button1.enabled = false statement out of the FORM open event and put it into an event procedure under the ON CURRENT form property
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.