473,382 Members | 1,736 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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 6828
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: FantaJ | last post by:
Hi, Is it possible to make a html button invisible using javascript? I can certainly disable it: var x=document.getElementById('button2'); x.disabled=true; //x.type = 'hidden'; // read...
2
by: Sam | last post by:
Trying to change the visible property on a command button (access97) based on a record felid on the form. The felid is a check box felid and I am trying to make the button disappear with the...
4
by: Rick | last post by:
Hello, I currently use a field that I have set up to keep notes in. It is a memo data type field. It looks like a simple box, and I typically time and date stamp my notes as I enter them. For...
9
by: Melissa | last post by:
What is the code to delete a command button from a form? Can the code be run from the click event of the button to be deleted? Thanks! Melissa
3
by: Colin Graham | last post by:
I have been working on a form to update a database when i enter details and click a button. My issue is that some of the users click the button twice. I want to remove the button when i click it...
14
by: Kevin | last post by:
A couple of easy questions here hopefully. I've been working on two different database projects which make use of multiple forms. 1. Where's the best/recommended placement for command buttons...
3
by: Scldb | last post by:
I have a form that is linked up to the tables. I turned off the Navigation buttons. I put in a new command button that when clicked, it opens up a new record. What is the code that is needed for this...
1
by: mdburton | last post by:
onclick="this.href='javascript:void(0)';this.disabled=1"> ive tried that, but it renders it useless and doesnt make it 'submit' it should be able to work, but so the user cannot submit it twice...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.