Solved

How do I have the text boxes not print.

Posted on 1998-08-04
3
153 Views
Last Modified: 2010-05-03
Hi, I am just learning Visual Basic and working on my first program. I have a form whith text boxes on it. When I print, it prints the boxes as well. Is there a way to have them show yet not print? I want them on th eform so the user knows to input their data but I don't want them to print, only want the info contained in the box to print. I tried setting Visibility to False but then they don't show up on the form at all. Please help me out if you can, email me at developer@xtremeonline.com if possible. Thank you.
0
Comment
Question by:ShawnX
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
jsuper earned 100 total points
ID: 1467809
Just before the code you are using to print the form, change the visibility of the text boxes to false.  Alfter the code that prints has completed, change the visibilty back to a yes.  For example...

Private Sub cmdPrint_Click()
      txtbox1.visible = false
      txtbox2.visible = false
      form.printform
      txtbox1.visible = true
      txtbox2.visible = true
end sub


0
 
LVL 1

Expert Comment

by:jsuper
ID: 1467810
Actually, now I see what you are saying...   here is what you need to do.   For each textbox, create a label as well. Set  each label.visible to false.  When the user says to print, perform the following code.

Private Sub Print_Click()
    label1.caption = text1.text
    label2.caption = text2.text
    label1.top = text1.top
    label2.top = text2.top
       ' do the same for width, height and left...
   label1.visible = true
  label2.visible = true
  text1.visible = false
  text2.visible = false
form1.printform
   ' Now change the visible settings back to the original values...  
   '  i.e.  textboxes as visible and labels as invisible.

That should do what you want...
0
 

Author Comment

by:ShawnX
ID: 1467811
I don't understand. I made them false, then they don't show up at all. Thanks for a fast reply to my question.

I'll just keep trying, till something works.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Copy a row 12 77
VBA Shell can't Find Word document 11 155
Macro Excel - Multiple If conditions 2 94
I need help using System.Web.HttpUtility.HtmlEncode in my VB.Net application 3 131
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question