Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
| Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA 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 February 16th, 2004, 09:29 PM
Friend of Wrox
 
Join Date: Sep 2003
Location: Madison, Wisconsin, USA.
Posts: 451
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Ben Horne
Default Apply VBA Code To Report Label If Possible

Hi all,

I've run into a case of what you'd call "database developer's block". That is, I know what I want to do but I don't know how to to accomplish it.

I have a report called "Online Music" that I use inside my Music Inventory 2001 application to track music that was listened to. I have a field called "Listen Date" that stores the date that a particular song was listened to.
    I want to have a message show up in the Listen Date field for those records whose "Listen Date" value is null. I'm thinking the message should be "No Date Specified". Is it possible to do this in VBA?

Thanks,



Ben Horne
Madison Area Technical College student
-------------------------
http://community.webshots.com/user/valerian114

Go there. I have a lot of awesome photos that I rendered myself
__________________
Ben Horne
-------------------------
I don\'t want to sound like I haven\'t made any mistakes. I\'m confident I have.

Most likely using FireFox and concocting my next Macromedia Flash project
Snibworks Forums Moderator

Welcome to the New Age
 
Old February 16th, 2004, 10:34 PM
Friend of Wrox
 
Join Date: Jul 2003
Location: Houston, Texas, USA.
Posts: 174
Thanks: 0
Thanked 0 Times in 0 Posts
Default

On your report, in the control source for your field Listen Date, use the following:

=iif(isnull([Listen Date]),"No Date Specified",[Listen Date])

If it's null, it will list your text. Otherwise, it will display the date.

Regards,

Beth M
 
Old February 18th, 2004, 12:16 AM
Friend of Wrox
 
Join Date: Sep 2003
Location: Madison, Wisconsin, USA.
Posts: 451
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Ben Horne
Default

Beth,

Thanks so much for your help. I did run into a few small problems but those have been taken care of and everything is functioning normally.

I already had a Listen Date textbox in the report prior to my first post so when I went in to make the changes to the "Online Music" report, the text boxes overlapped so I ended up getting rid of the original textbox and replacing it with a new one.

Thanks again,


Quote:
quote:Originally posted by BethMoffitt
 On your report, in the control source for your field Listen Date, use the following:

=iif(isnull([Listen Date]),"No Date Specified",[Listen Date])

If it's null, it will list your text. Otherwise, it will display the date.

Regards,

Beth M
Ben Horne
Madison Area Technical College student
-------------------------
http://community.webshots.com/user/valerian114

Go there. I have a lot of awesome photos that I rendered myself
 
Old February 18th, 2004, 10:12 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: Houston, Texas, USA.
Posts: 174
Thanks: 0
Thanked 0 Times in 0 Posts
Default

My pleasure :)




Similar Threads
Thread Thread Starter Forum Replies Last Post
how to access with code-behind a label embedded in hertendreef ASP.NET 2.0 Basics 3 March 12th, 2007 06:47 AM
Label onmouseover in code behind wareclause ASP.NET 2.0 Basics 11 February 5th, 2007 06:00 PM
How to apply the code of book on sql server? sharking BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 15 May 1st, 2006 10:20 AM
Display Label for first record only in report mwn1218 Access VBA 6 January 26th, 2005 10:00 AM
Need help with using crsytal for mail label report divinyl Crystal Reports 0 December 5th, 2003 05:58 AM





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