Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Muliple "IF" trouble, need help...

Status
Not open for further replies.

caman74

IS-IT--Management
Jan 1, 2005
67
NO
Hello!

I have a table called "Invoice".
Inside it i have the fields "Code", "Dep" and "Account".
In the "code" field I either type a two caracter number or a eight caracter number. I.e. "77", "34" or "32090123", "50112112".
The "Dep" field uses the function "left" to find the two first caracters. I.e: "Code"="73159112" = "Dep"="73" or "Code"="34" = "Dep"="34".

Then comes my problem;
If I type "34" or "35" or "77" in the "code" field the "Account" should say "43430".
If I type a number between "34000000" and "34999999" or between "35000000" and "35999999" or "77000000" and "77999999" the "Account" field should say "22343"
Else the "Account" field should say "50111".

I have tryed several settings, but somehow it will not work, so I need your help...

Regards

Christian
 
Don't know the how and why, or if the outcome has to be dynamic or not.

See what the 'Case' function can do for you.

Case(
yourField;theValues01;your result01;
yourField;theValues02;your result02;
defaultValue
)

HTH
 
Thanks.

It worked.
I've to learn to think "outside the MS Access" box.

Christian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top