473,320 Members | 1,746 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,320 software developers and data experts.

Disable/Enable

soramaster
How do I make it where something disabled until you put some kind of code in, S/N?

Like on some program trials it will need a code to enable some buttons.functions,etc.


On mine I want some stuff disabled until you enter a code in to enable it.

Like I want one of my command buttons disabled.

Thanks
Jun 13 '07 #1
6 1834
kadghar
1,295 Expert 1GB
if you want to enable a command button when you write something into a text box, just check the sub

Expand|Select|Wrap|Line Numbers
  1. Private Sub TextBox1_Change()
  2. If TextBox1.Text <> "" Then
  3. CommandButton1.Enabled = True
  4. Else
  5. CommandButton1.Enabled = False
  6. End If
  7. End Sub
And this way, also, when the txt box is cleared, the button will be disabled once again
Jun 13 '07 #2
kadghar
1,295 Expert 1GB
FYI

That sub can be found when double clicking the textbox, in the upper left menu

Kad
Jun 13 '07 #3
kadghar
1,295 Expert 1GB
FYI

That sub can be found when double clicking the textbox, in the upper left menu

Kad
upper RIGHT (gee... you shouldn't let drunk people write posts around here)
Jun 13 '07 #4
Ok thanks ill give it a try
Jun 14 '07 #5
Sweet. Thanks alot. Now all I have to do is make it work with a S/N and I can start working on the other stuff.



THANKS
Jun 14 '07 #6
debasisdas
8,127 Expert 4TB
try this one also
=============
Expand|Select|Wrap|Line Numbers
  1. Private Sub TextBox1_Change()
  2. Command1.Enabled = len(trim(TextBox1.Text)) > 0
  3. End Sub
  4.  
Jun 14 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Alphonse Giambrone | last post by:
I am trying to enable/disable a requiredfieldvalidator on the client side and am generating an error. I had found some documentation on validation which states that I should be able to...
0
by: Robert Ladd | last post by:
Hi, I'm trying to disable the asp.net calendar control from a javascript function, but it doesn't disable the doPostBack. To simplify the situation, assume a page with 4 controls. A...
0
by: talal | last post by:
How to check whether javascript is enable or disable in client browser. Remeber i can check wheter browser client support javascript with BrowserCapability class. But what if the client has disable...
4
by: mabond | last post by:
Does anyone know some code that will allow me to enable and/or disable a task which already exists in the task scheduer. I have a task which runs at 15 min intervals and from time to time I want to...
4
by: Matrixreloadedth | last post by:
How to change disable color of Checkbox??? I have a checkbox with forecolor in red but when i disable by set Enable properties to false forecolor is changed to gray color but i don't want it. how...
2
by: PamelaDV | last post by:
I am wondering if there is a way to disable the "X" used to close the Access application window? I know how to disable it for individual forms, but I would like to disable it for the application...
4
by: Phoe6 | last post by:
Hi all, I am trying to disable the NIC card (and other cards) enabled in my machine to test diagnostics on that card. I am trying to disable it programmatic using python. I checked python wmi and...
3
by: Pietro | last post by:
Hi all, First of all I'd like to thank you very very much ,as finally after many years of searching,I could find a code to disable/enable the shift key,but actually i cannot use the code as I'm...
8
by: sebouh181 | last post by:
I am writing to registry using javascript. var wsh = new ActiveXObject("WScript.Shell"); var key = "HKLM\\Software\\Neos\\2.0\\LightMode\\my-script"; wsh.RegWrite (key, 1999, "REG_SZ"); when i...
2
by: Naushad | last post by:
Hi all, I am using the countinous form. I want to Enable/Disable the some fields for perticular records as per the following condition when open the form. I have written this code in "On Current...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.