Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 19th, 2005, 10:34 AM
Authorized User
Join Date: Jul 2005
Location: , , .
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default Clearing a label in FORM LOAD


I need to write some VBA code to clear a label in FORM LOAD.
Reply With Quote
  #2 (permalink)  
Old July 19th, 2005, 12:44 PM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG

To clear a label in the form load, you can simply write

Me.lblMyLabel.Caption = ""

but this may cause problems. I don't know if labels can be set to zero length; so you can hide it entirely but not clear it, e.g.

Me.lblMyLabel.Visible = False

Replace "lblMyLabel" with the actual name of your label.

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
Reply With Quote
  #3 (permalink)  
Old July 19th, 2005, 01:22 PM
Authorized User
Join Date: Jul 2005
Location: , , .
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts

Greg thank you for your help this is what I end up doing.

Private Sub Form_Open(Cancel As Integer)
'disable editing if contract is closed
If Me.Closed.Value = True Then
    Me.AllowEdits = False
    Me.lblContractClosed.Visible = True
    Me.AllowEdits = True
     Me.lblContractClosed.Visible = False
End If

'If EURO is chcked display EURO on invoice form
If Forms![Invoice Scanner].EURO = True Then
   Forms![Invoice Scanner]!InvSub.Form!CurPayIn = "EURO"

'If GBP is checked othen display GBP on nnvoice
ElseIf Forms![Invoice Scanner].GBP = True Then
       Forms![Invoice Scanner]!InvSub.Form!CurPayIn = "GBP"

'If GBP and EURO = false then display U.S. dollars
Forms![Invoice Scanner]!InvSub.Form!CurPayIn = "U.S. Dollars"

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
clearing out the form x_ray VB.NET 2002/2003 Basics 9 February 21st, 2006 04:44 PM
clearing the form europhreak Dreamweaver (all versions) 1 September 18th, 2005 03:35 AM
register.php: clearing html form fields lamada BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 October 26th, 2004 01:25 PM
Clearing a Form jbenson001 ASP.NET 1.x and 2.0 Application Design 2 December 3rd, 2003 11:43 AM
Clearing values from form and ASP variables sniffer Classic ASP Basics 1 September 24th, 2003 02:40 AM

All times are GMT -4. The time now is 09:42 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.