Disable a Command Button

Within the form “frmIncidentForm” I have a textbox and a command button.

I would like to disable the “AddIncident” button when the “IncidentID”
textbox is NOT empty. If possible I would like the code in the Forms Event
“On Current”.

Thanks

--
Message posted via http://www.accessmonster.com
u36225 [ Do, 10 Januar 2008 16:45 ] [ ID #1904578 ]

Re: Disable a Command Button

pushrodengine via AccessMonster.com wrote:

> Within the form “frmIncidentForm” I have a textbox and a command button.
>
> I would like to disable the “AddIncident” button when the “IncidentID”
> textbox is NOT empty. If possible I would like the code in the Forms Event
> “On Current”.
>
> Thanks
>

In the OnCurrent event enter
Me.AddIncident.Enabled = (IsNull(Me.IncidentID))

Nymphs
http://www.youtube.com/watch?v=gg7WG6tCbrw
Salad [ Do, 10 Januar 2008 17:17 ] [ ID #1904580 ]

Re: Disable a Command Button

"Salad" <oil [at] vinegar.com> wrote in message
news:13och82qjr7h195 [at] corp.supernews.com...
> pushrodengine via AccessMonster.com wrote:
>
>> Within the form "frmIncidentForm" I have a textbox and a command button.
>> I would like to disable the "AddIncident" button when the "IncidentID"
>> textbox is NOT empty. If possible I would like the code in the Forms
>> Event
>> "On Current".
>>
>> Thanks
>>
>
> In the OnCurrent event enter
> Me.AddIncident.Enabled = (IsNull(Me.IncidentID))
>

You might also consider adding some code in the AddIncident_AfterUpdate
event to disable the button when somebody puts data into the AddIncident
textbox.
Fred Zuckerman
Fred Zuckerman [ Do, 10 Januar 2008 18:16 ] [ ID #1904586 ]

Re: Disable a Command Button

Thank you for your help!

--
Message posted via http://www.accessmonster.com
u36225 [ Fr, 11 Januar 2008 19:15 ] [ ID #1905414 ]
Datenbanken » comp.databases.ms-access » Disable a Command Button

Vorheriges Thema: Group tables in a pivot
Nächstes Thema: Group tables in a pivot