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 / General 2 / February 2007

Tip: Looking for answers? Try searching our database.

Wish I could use a "if statement"

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Fmummey - 21 Feb 2007 20:23 GMT
I'm trying to prevent printing of a private phone number field based on a
field used to identify the number as "Public" or "Private".  I seem to only
include record or bypass whole record....
Signature

Frank

Adam Clark - 21 Feb 2007 20:28 GMT
Is this in a report or on a form?

For a report us IIF, for a form use the VB If...Then... statement.

> I'm trying to prevent printing of a private phone number field based on a
> field used to identify the number as "Public" or "Private".  I seem to
> only
> include record or bypass whole record....
fredg - 21 Feb 2007 20:35 GMT
> I'm trying to prevent printing of a private phone number field based on a
> field used to identify the number as "Public" or "Private".  I seem to only
> include record or bypass whole record....

In an unbound text control:
=IIf([SomeField] = "Public",[PhoneNumber],"")

Make sure the name of this control is not the same as the name of any
field used in it's control source expression.
Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

'69 Camaro - 21 Feb 2007 20:47 GMT
Hi, Frank.

> I seem to only
> include record or bypass whole record....

This sounds like you're using a query, not a form or report to show
individual text boxes.  It would be helpful to give enough information so
that folks answering your question don't have to guess the context of what
you're trying to do.  If you are using a query, then try the following
example syntax in your query:

SELECT IIF(Nz(Status, "") = 'Public', tblMyTable.Phone, Null) AS Phone
FROM tblMyTable;

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blog:  http://DataDevilDog.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.

> I'm trying to prevent printing of a private phone number field based on a
> field used to identify the number as "Public" or "Private".  I seem to
> only
> include record or bypass whole record....
 
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.