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 / April 2007

Tip: Looking for answers? Try searching our database.

If, Then Statements

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sharon Walls - 25 Apr 2007 15:24 GMT
What if [Charge] is a numeric field? Would the same apply
Ofer Cohen - 25 Apr 2007 16:02 GMT
By trying to undestand your prev post, try

If 5 or More, then 4
If 3 or 4, then 2
If 1 0r 2, then O

IIf([Charge] > 5 , 4 , IIf([Charge] In (3,4) , 2, 0))

Signature

Good Luck
BS"D

> What if [Charge] is a numeric field? Would the same apply
Ofer Cohen - 25 Apr 2007 16:04 GMT
Sorry, need to add =>

IIf([Charge] >= 5 , 4 , IIf([Charge] In (3,4) , 2, 0))

Signature

Good Luck
BS"D

> By trying to undestand your prev post, try
>
[quoted text clipped - 5 lines]
>
> > What if [Charge] is a numeric field? Would the same apply
Sharon Walls - 25 Apr 2007 16:26 GMT
Will this still work if you are setting up an if, then statement where the
data your are pulling from is in a look-up column.
I tried using this same formula and it is coming up error but works when
just a text or numeric field.

> By trying to undestand your prev post, try
>
[quoted text clipped - 5 lines]
>
> > What if [Charge] is a numeric field? Would the same apply
Ofer Cohen - 25 Apr 2007 16:44 GMT
If you want to use it in a form, and display the right value depend on the
value selected in a combo box, you can create another text box in the form
and in the control source of it write

=IIf(Nz([ComboName],0) >= 5 , 4 , IIf(Nz([ComboName],0) In (3,4) , 2,
IIf(Nz([ComboName],0) In (1,2),0,Null)))

The Nz used to convert Null with 0, Null might return error.
This way no code is involved

Signature

Good Luck
BS"D

> Will this still work if you are setting up an if, then statement where the
> data your are pulling from is in a look-up column.
[quoted text clipped - 10 lines]
> >
> > > What if [Charge] is a numeric field? Would the same apply
Sharon Walls - 26 Apr 2007 03:14 GMT
When you say [ComboName] what field do I use?
The field that is doing the look-up?

> If you want to use it in a form, and display the right value depend on the
> value selected in a combo box, you can create another text box in the form
[quoted text clipped - 20 lines]
> > >
> > > > What if [Charge] is a numeric field? Would the same apply
 
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.