How to make command button disappear

I have a command button that I'd like to make "disappear" after being
clicked and after the OnClick function has executed. I have tried
changing the 'visible' attribute to false while within the OnClick
function but that won't work because the button control has the focus.

I traced and put a trap at the top of form_current but it didn't hit
there.

Any suggestions?

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
Susan Bricker [ Sa, 19 Januar 2008 16:34 ] [ ID #1911999 ]

Re: How to make command button disappear

Move the focus to something else before turning visibility off

"Susan Bricker" <slbrick [at] verizon.net> wrote in message
news:47921882$0$506$815e3792 [at] news.qwest.net...
>I have a command button that I'd like to make "disappear" after being
> clicked and after the OnClick function has executed. I have tried
> changing the 'visible' attribute to false while within the OnClick
> function but that won't work because the button control has the focus.
>
> I traced and put a trap at the top of form_current but it didn't hit
> there.
>
> Any suggestions?
>
> Regards,
> SueB
>
> *** Sent via Developersdex http://www.developersdex.com ***
scott [ Sa, 19 Januar 2008 16:45 ] [ ID #1912000 ]

Re: How to make command button disappear

What makes it visible again

Phil

"Scott" <scott.n.jill [at] ns.sympatico.ca> wrote in message
news:47921b36$0$4040$9a566e8b [at] news.aliant.net...
> Move the focus to something else before turning visibility off
>
> "Susan Bricker" <slbrick [at] verizon.net> wrote in message
> news:47921882$0$506$815e3792 [at] news.qwest.net...
>>I have a command button that I'd like to make "disappear" after being
>> clicked and after the OnClick function has executed. I have tried
>> changing the 'visible' attribute to false while within the OnClick
>> function but that won't work because the button control has the focus.
>>
>> I traced and put a trap at the top of form_current but it didn't hit
>> there.
>>
>> Any suggestions?
>>
>> Regards,
>> SueB
>>
>> *** Sent via Developersdex http://www.developersdex.com ***
>
>
Phil Stanton [ Sa, 19 Januar 2008 17:22 ] [ ID #1912002 ]

Re: How to make command button disappear

Phil,

Ok .. you asked for it.

The screen frmEvents has a subform sfrmTrialInfo which has a subform
sfrmTCI. The command button (btnCre8ClassRecs) is on sfrmTrialInfo.
When clicked it will create 8 class records associated with that
particular Trial, which will appear in sfrmTCI (TrialClass Info
Records). I want that button to only be visible if there are NO CLASS
RECORDS for that particular Trial.

When the sfrmTrialInfo is opened the visible attribute of the button is
"gated" on whether there are any Class Records.

Once the button disappears (which is what I am looking to do) for that
particular Trial Record there is no need to reveal that button again
because the Class Records have already been created. Therefore, once
the button disappears I don't need it to reappear for that Trial record.
The Class Records are not deletable from within this screen. However,
if we go out and then into the screens which enable record deletion,
when we come back into this display info screen the button will reappear
because there are no class records.

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
Susan Bricker [ Sa, 19 Januar 2008 18:05 ] [ ID #1912003 ]

Re: How to make command button disappear

Great. i'll give it a try. What I did in the interim was to make
subequent clicks on that button effectively "not do anything" (an
inelegant solution to my wanting that button to disappear).

Thank you for your help.

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
Susan Bricker [ Sa, 19 Januar 2008 18:05 ] [ ID #1912004 ]

Re: How to make command button disappear

Scott,

How simple was that? Works great. Thank you.

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
Susan Bricker [ Sa, 19 Januar 2008 18:42 ] [ ID #1912005 ]
Datenbanken » comp.databases.ms-access » How to make command button disappear

Vorheriges Thema: access 2007 runtime and help button
Nächstes Thema: Odd report behaviour