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

Disable Print Button

dear all,

I want to disable print button in case text box are empty

please advise because i am prety unfamiliar with visual basic

please please

thanks
Jul 14 '10 #1
3 3191
mseo
181 100+
@flip345
hi,
welcome to bytes
why should you do so?
you can replace a code behind print cmdbutton to let msgbox fires for you if the textbox is null
or you can use beforeupdate trigger to handle if the textbox is null, and you can disable the print button or even hide it, just see which approach is appropriate for your form , and let me know
hope this helps
Jul 14 '10 #2
Jim Doherty
897 Expert 512MB
All sorts of logic can be applied here depending precisely on what it is you are doing but the general principle from only one perspective is to cancel out any on click event of that button with something simple

Expand|Select|Wrap|Line Numbers
  1. If IsNull(Me!MyTextboxName) Then
  2. MsgBox "Hey you have not completed the textbox " & Me!TextBoxName.Name
  3. Exit Sub
  4. End If
If your aim however is to 'enable' a 'disabled' button at a particular certain point in time then the issue is to validate your screen controls by looping through them and testing for data entry. If the controls examined in the loop qualify only then enable.

This reply is simplistic I know but having to guess from a one line post is not particular helpful to those so inclined to contribute particularly if your knowledge of VBA is somewhat limited
Jul 14 '10 #3
NeoPa
32,556 Expert Mod 16PB
As the others have said already, it's a bit hard to answer a question when there is almost no question to answer.

I'm sure you'll get more help if you can manage to post your question fully and clearly.

Welcome to Bytes!
Jul 14 '10 #4

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

Similar topics

2
by: Assaf | last post by:
Hi, I added to my setup project TextBox dialog control which contains two textbox. I want to add the ability to disable the next button until the user enter some text in the textbox (let's say...
6
by: Dennis Allen | last post by:
Hi. On one particular web page I want to offer the user a print button. Question. How do I create one? Something compatible with most browsers would be nice. Appreciate any advice...Dennis
1
by: microsoft | last post by:
I am looking for code for a button on a website, and I want it to prevent users from clicking more than once while their request is being processed. I would like it to disable or hide the button...
2
by: Ghafran Abbas | last post by:
Call this function from the Page_OnLoad event of your asp.net page. This will prevent the user from doing multiple post backs or button clicks. This was designed to not disable the button, because...
2
by: blarfoc | last post by:
Hi, I have to disable a button on a aspx page after the user clicks it. I have to disable the button with javascript because the process takes 20 seconds to run the full course. I kno I need to...
16
by: Barry Gilmore | last post by:
Is there a way to disable a button after it is clicked? I am trying to avoid having someone click on it twice while they wait for it to process. Thank you!
6
by: Stuart Quinn | last post by:
Is there a way to disable a button to disallow a user to click on it more than once? Thanks!
3
by: applegreenss | last post by:
I am looking for a javascript function ( don't know what they call ths ) which will print a line of text, one letter at a time at a certain speed until the full string is printed. Can this be done...
1
by: hexagram | last post by:
hi can anybody here help me on my problem the condition is if the form is blank or incomplete or not save the print button is disable, otherwise if the form is fill up complete and saved the...
2
by: jbaptist | last post by:
I have 2 buttons on the form, Button A and button B. I want to enable button A from 6am till 6pm from Monday to Friday and to disable button B during 6am until 6pm. And I want to disable button...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.