Disable Print Button

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • flip345
    New Member
    • Jul 2010
    • 1

    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
    Last edited by NeoPa; Jul 14 '10, 12:57 PM. Reason: Added question to post
  • mseo
    New Member
    • Oct 2009
    • 183

    #2
    Originally posted by flip345
    please advise because i am prety unfamiliar with visual basic

    please please

    thanks
    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

    Comment

    • Jim Doherty
      Recognized Expert Contributor
      • Aug 2007
      • 897

      #3
      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

      Code:
      If IsNull(Me!MyTextboxName) Then
      MsgBox "Hey you have not completed the textbox " & Me!TextBoxName.Name
      Exit Sub
      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

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32661

        #4
        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!

        Comment

        Working...