By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,102 Members | 967 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,102 IT Pros & Developers. It's quick & easy.

Auto-calculate a form based on another field's contents

P: n/a
I am using Access 2000 and have a table, tblCurrent. That table
contains several fields - three of those fields are [Weight], [Count]
and [BaleWt]. What I want to accomplish in my data entry form, is
first entering the [Count], then enter a [BaleWt] if known, and lastly
have [Weight] calculate the total weight of [Count]*[BaleWt] if
[BaleWt] Is Not Null. If I don't know the BaleWt, I will simply enter
the gross weight.

Here is the formula I've tried to use, but it is not working:

IIF([BaleWt] Is Not Null),[Count]*[BaleWt],)

I've tried having that as the Control Source in the form, I've tried
using it as the Default Value, but can't get it to work.

Thanks in advance for any direction someone may offer...

Carla
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
IIF needs three arguments: IIF (conditions; Value if conditions = true;
Value if conditions = false). So it looks like you are missing an argument
for value if BaleWT is Null. It should be 0 or Null ?

Brgds
Rolfern

"carla" <he*******@sbcglobal.net> wrote in message
news:46**************************@posting.google.c om...
I am using Access 2000 and have a table, tblCurrent. That table
contains several fields - three of those fields are [Weight], [Count]
and [BaleWt]. What I want to accomplish in my data entry form, is
first entering the [Count], then enter a [BaleWt] if known, and lastly
have [Weight] calculate the total weight of [Count]*[BaleWt] if
[BaleWt] Is Not Null. If I don't know the BaleWt, I will simply enter
the gross weight.

Here is the formula I've tried to use, but it is not working:

IIF([BaleWt] Is Not Null),[Count]*[BaleWt],)

I've tried having that as the Control Source in the form, I've tried
using it as the Default Value, but can't get it to work.

Thanks in advance for any direction someone may offer...

Carla

Nov 12 '05 #2

P: n/a
Well, the false argument is that it should do nothing except allow me to
enter the Weight. I'd hoped that if I just left a comma at the end and
there was nothing after that comma, that it would then give me the
result I was looking for.

Thanks,
Carla

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3

P: n/a
Also, you are better off not storing your calculation. Store all the figures
required to create the calculation, but only calc when needed, like on the
form, report or in query.

Mike Storr
www.veraccess.com
"R.A.Balder" <R_********@xhotmail.com> wrote in message
news:KI*********************@juliett.dax.net...
IIF needs three arguments: IIF (conditions; Value if conditions = true;
Value if conditions = false). So it looks like you are missing an argument for value if BaleWT is Null. It should be 0 or Null ?

Brgds
Rolfern

"carla" <he*******@sbcglobal.net> wrote in message
news:46**************************@posting.google.c om...
I am using Access 2000 and have a table, tblCurrent. That table
contains several fields - three of those fields are [Weight], [Count]
and [BaleWt]. What I want to accomplish in my data entry form, is
first entering the [Count], then enter a [BaleWt] if known, and lastly
have [Weight] calculate the total weight of [Count]*[BaleWt] if
[BaleWt] Is Not Null. If I don't know the BaleWt, I will simply enter
the gross weight.

Here is the formula I've tried to use, but it is not working:

IIF([BaleWt] Is Not Null),[Count]*[BaleWt],)

I've tried having that as the Control Source in the form, I've tried
using it as the Default Value, but can't get it to work.

Thanks in advance for any direction someone may offer...

Carla


Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.