Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / January 2005

Tip: Looking for answers? Try searching our database.

How to print "All" on report if listbox null

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DOYLE60 - 02 Jan 2005 03:38 GMT
I have a listbox on a form that filters a report.  When nothing is chosen, the
code interprets this as all chosen.

I have a textbox on a report that lists the selections chosen:

    =enumrecord("PrintDialogInventoryFranchiseLBqry2")

So if nothing is chosen (meaning all is actually chosen), the above will in
fact list all.

This all works fine.

But I now want to simply print in that textbox on the report the word "All"
when nothing is chosen in the list box (meaning all chosen, of course).  Right
now it would print all the items in the list box.

I tried this formula:

      =IIf([Forms]![InventoryDialogPrintfrm]![FranchiseChosen] Is            
     Null,"All",enumrecord("PrintDialogInventoryFranchiseLBqry2"))

But that doesn't work.

I know I should use some sort of line like:

   If Len(Criteria) = 0 Then

But don't know how I should put this all together.

The form is: InventoryDialogPrintfrm
The List box is: FranchiseChosen
The query that contains the chosen list box items is:
PrintDialogInventoryFranchiseLBqry2

Thanks so much,

Matt
Alex Dybenko - 02 Jan 2005 08:40 GMT
Hi,
try to use:
IIf(isnull([Forms]![InventoryDialogPrintfrm]![FranchiseChosen]),...

or
IIf(len([Forms]![InventoryDialogPrintfrm]![FranchiseChosen] & ''),...

Signature

Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com

>I have a listbox on a form that filters a report.  When nothing is chosen,
>the
[quoted text clipped - 37 lines]
>
> Matt
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.