473,748 Members | 2,328 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 6865
Move the focus to something else before turning visibility off

"Susan Bricker" <sl*****@verizo n.netwrote in message
news:47******** *************@n ews.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**********@n s.sympatico.caw rote in message
news:47******** **************@ news.aliant.net ...
Move the focus to something else before turning visibility off

"Susan Bricker" <sl*****@verizo n.netwrote in message
news:47******** *************@n ews.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 (btnCre8ClassRe cs) 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
31773
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 only? //x.visible = false; // doesn't exist?
2
7610
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 check box s checked. The commend button name is command36 and the check bx feild is named . I have written the following code: IIf Me! = True, Me!Command36.Visible = -1, Me!Command36.Visible
4
2489
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 now, whenever I want to add a new note to one of my files I will click once at the very top left corner of the field, hit <enter> twice to move all the previous notes down two levels, then I move the cursor back up to the top left again, then I'll...
9
5723
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
1872
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 and show a label saying "Processing" How can i do this using the attributes.add code ??? thanks in advance C
14
4971
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 for things like delete, save, edit, cancel buttons - in the footer, or on the form detail section? 2. If in the footer, how do you add them to the tab order?
3
1951
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 to happen?
1
4536
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 if they tried to 'machine gun' type thing using their mouse to submit repeatedly I guess this can be considered an HTML problem not PHP but im using it in php in the sense that the button clicked triggers the form to load and it has data that is...
0
8983
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8822
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9528
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9310
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8235
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6072
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4863
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3298
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2774
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.