469,619 Members | 1,914 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,619 developers. It's quick & easy.

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 ***
Jan 19 '08 #1
5 6537
Move the focus to something else before turning visibility off

"Susan Bricker" <sl*****@verizon.netwrote in message
news:47*********************@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 ***

Jan 19 '08 #2
What makes it visible again

Phil

"Scott" <sc**********@ns.sympatico.cawrote in message
news:47**********************@news.aliant.net...
Move the focus to something else before turning visibility off

"Susan Bricker" <sl*****@verizon.netwrote in message
news:47*********************@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 ***


Jan 19 '08 #3
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 ***
Jan 19 '08 #4
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 ***
Jan 19 '08 #5
Scott,

How simple was that? Works great. Thank you.

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
Jan 19 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.