conditional calcuations

  • Thread starter gmenon100 via AccessMonster.com
  • Start date
G

gmenon100 via AccessMonster.com

Hi,

I am doing an access project with SQL backend. I am sure this must have been
discussed earlier, but was not able to trace the solution:

i have a field for which i want to formulate the below, except that instead
of 0 for the false, it should allow me an input.

Currently if the status is 2, it correctly computes the value, but when the
status is any other number, it returns 0 because of the below statement. Can
someone please help me formulate this so that when false it should either
prompt me for a value or allow me to type in a value into the field??

case [STATUS] when 2 then (convert(money,round(([invqty] * [invprice]),2)))
else 0 end)

thank you for any help.

Gmenon
 
V

Vadim Rapp

gvA> Currently if the status is 2, it correctly computes the value, but
gvA> when the status is any other number, it returns 0 because of the below
gvA> statement. Can someone please help me formulate this so that when
gvA> false it should either prompt me for a value or allow me to type in a
gvA> value into the field??

The code running on the server can't do that. You need to do that in the
code of your frontend part.

Vadim Rapp
 
G

gmenon100 via AccessMonster.com

I am just a novice and would appreciate if you can elaborate this for me.
 
V

Vadim Rapp

gvA> I am just a novice and would appreciate if you can elaborate this for
gvA> me.

Your application has two parts: front-end adp that ineracts with the user,
and code on sql server that returns the data in response to adp's requests,
but can't interact with the user. The code you posted belongs to the latter.
So, it can't ask anything. You have to write code in vba for the frontend
that will do what you want when it receives zero from the server.

Vadim Rapp
 
G

gmenon100 via AccessMonster.com

Thanks Vadim,

Appreciate your response. I will give it a try.

Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top