Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access 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 January 17th, 2006, 02:55 AM
Friend of Wrox
 
Join Date: Dec 2005
Posts: 233
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to anukagni Send a message via Yahoo to anukagni
Default Using "--"while the lable is empty in Report


 Hi Guy's
         I having an report in which i gon an data lable , in that it may not having data for some time so i would like it to apppear like -- or "Nill". How can make this in the Ms Access

 Pls clarify my Probs,

 thanks & Regards.,
 Pap:)
 
Old January 19th, 2006, 09:25 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

You need to check the field that is empty, and then set the label text as a condition of the field value. I think this is what you want to do. So on the form's Detail section On Format event, you might put:

'-----

If IsNull(Me.TextBox) Or Me.TextBox = "" Then
   Me.DataLabel.Text = "--"
   Else
   Me.DataLabel.Text = "Your Value Here"
End If

'-----

Does this work? I know other posters might have a more elegant way to do this, but no one has posted yet.

HTH


mmcdonal
 
Old January 20th, 2006, 03:40 AM
Friend of Wrox
 
Join Date: Dec 2005
Posts: 233
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to anukagni Send a message via Yahoo to anukagni
Default

Hi donal,

  I got ur idea but iam not able to do the function .I want this "----" text should appear in the report .

P.A.P.Raguv
 
Old January 20th, 2006, 08:21 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Okay, here is another idea:

In the detail of your report, put an unbound label, and add the text to that label that you want. ---

Then put this code in the Detail section's On Format event:

'-------------

If IsNull(Me.YourTextBoxName) Or Me.YourTextBoxName = "" Then
   Me.YourTextBoxName.Visible = False
   Me.Your---LabelName.Visible = True
   Else
   Me.YourTextBoxName.Visible = True
   Me.Your---LabelName.Visible = False
End IF

'-------------

I know this will work. Please understand that when I use "Me.YourTextBoxName" I am using a generic name and you must supply the actual name of the field that you want to appear or disappear. The same with "Me.Your---LabelName". That will be called "Label11" for example.

HTH



mmcdonal





Similar Threads
Thread Thread Starter Forum Replies Last Post
Glow the lable in From anukagni Access 15 October 17th, 2008 11:36 AM
multiline lable kripa ostwal Visual Basic 2005 Basics 1 April 6th, 2007 06:41 AM
hiding empty text boxes in an Access report EricTheViking Access 4 September 7th, 2006 11:43 AM
glowing the lable while mouse move anukagni Access 3 July 27th, 2006 12:47 AM





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