Solved

How do I have the text boxes not print.

Posted on 1998-08-04
3
156 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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month4 days, 8 hours left to enroll

635 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