Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 19th, 2005, 10:34 AM
Authorized User
 
Join Date: Jul 2005
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default Clearing a label in FORM LOAD

Hello,

I need to write some VBA code to clear a label in FORM LOAD.
 
Old July 19th, 2005, 12:44 PM
Friend of Wrox
 
Join Date: Jun 2003
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
Default

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
 
Old July 19th, 2005, 01:22 PM
Authorized User
 
Join Date: Jul 2005
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Else
    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
Else
Forms![Invoice Scanner]!InvSub.Form!CurPayIn = "U.S. Dollars"






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





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