Enabling of Buttons on a form

DazedandMuddled

is not hard? is it......?
Local time
Today, 14:19
Joined
Apr 9, 2004
Messages
11
Quick question (and probably very simple :D )

on a form how can i disable a button when i move to another record.

ie. the button is named btnName

the function of it is to execute the command

DoCmd.GoToRecord , , acNewRec

obviously this opens another record but the button is still enabled how do i disable it -is it on the onload or afterupdate element of the form??

Thanks
Cam
 
I think it is the form's On Current event you want. This event is activated when you move to a new record, or the form is refreshed.
 
add the following code after

Code:
DoCmd.GoToRecord , , acNewRec

btnname.visible = false
 
mousemat said:
add the following code after

Code:
DoCmd.GoToRecord , , acNewRec

btnname.visible = false

.visible won't work as this will hide the button, i want to disable it (grey out the text on the button)

FoFa - i'll try the on current and see what happens! Tx
 
Last edited:
FoFa said:
I think it is the form's On Current event you want. This event is activated when you move to a new record, or the form is refreshed.

excellent - just where its meant to go

Thanks FoFa

mousemat sorry if that answer appeared short - wasn't meant to! :o
 

Users who are viewing this thread

Back
Top Bottom