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 / February 2006

Tip: Looking for answers? Try searching our database.

Expression within a Query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Teri - 02 Feb 2006 18:11 GMT
As you can tell I am new to Access.  

I have a query with a field called Value.  I would like to create an
expression field that would give me the following:

If, Value equals IPS or ECR, then IPS/ECR, otherwise use the Value.

I have tried:  IIf [Value]=[IPS]![IPS/ECR].
This of course doesn't work, but I am not sure of the wording for such a
statement.  Any help would be greatly appreciated.
fredg - 02 Feb 2006 20:31 GMT
> As you can tell I am new to Access.  
>
[quoted text clipped - 6 lines]
> This of course doesn't work, but I am not sure of the wording for such a
> statement.  Any help would be greatly appreciated.

1) Value is a reserved Access/VBA/Jet word and should not be used as a
field name.
For additional reserved words, see the Microsoft KnowledgeBase article
for your version of Access:

109312  'Reserved Words in Microsoft Access'  for Access 97
209187  'ACC2000: Reserved Words in Microsoft Access'
286335  'ACC2002: Reserved Words in Microsoft Access'
321266  'ACC2002: Microsoft Jet 4.0 Reserved Words'

2) After you change the field name to something else try:
Exp:IIf([AValue] = "IPS" or [AValue] = "ECR","IPS/ECR",[AValue])

Signature

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

Teri - 02 Feb 2006 20:41 GMT
Thanks much,  I will check out the resources you suggested.

Teri

> > As you can tell I am new to Access.  
> >
[quoted text clipped - 19 lines]
> 2) After you change the field name to something else try:
> Exp:IIf([AValue] = "IPS" or [AValue] = "ECR","IPS/ECR",[AValue])
 
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.