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

Tip: Looking for answers? Try searching our database.

Iff statement in Tables

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
troy - 19 May 2006 15:51 GMT
I have a table which has a field that carries the Y/N (-1 or 0) value. I am
updating to a table that has the same field but is an text field that is
manually put in as a Y or N. I want to put an expression in the default value
of the fieled which turns the Y/N (-1 or 0) into a Y or N text field.
I have tried to use the below but it is not correct. Can some one give me a
direction. I just want the filed to turn to a Y or N when updated and thought
the below expression would work? Can someone help?

IIf(Nz([TblProductVersionRefill]![Attachments],0)=-1,"Y","N")
Klatuu - 19 May 2006 15:58 GMT
That is not going to work.
How are you trying to do the update, from a form, a query, etc?

Would it not be better in the long run if you changed the table with the Y/N
to use the -1/0?

It would not be that difficult.
Add a new field to the table that has the Y/N data type.
Run an Update query that reads the old field and makes the new field True if
the old field is Y and False if it is N.
Delete the old field from the table.
Change the name of the new field to what the old field was.
You may have to change some code in your database, but this is a better
approach.

> I have a table which has a field that carries the Y/N (-1 or 0) value. I am
> updating to a table that has the same field but is an text field that is
[quoted text clipped - 5 lines]
>
> IIf(Nz([TblProductVersionRefill]![Attachments],0)=-1,"Y","N")
 
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.