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 / SQL Server / ADP / August 2006

Tip: Looking for answers? Try searching our database.

conditional calcuations

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
gmenon100 - 17 Aug 2006 16:38 GMT
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
Vadim Rapp - 18 Aug 2006 13:18 GMT
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
gmenon100 - 18 Aug 2006 16:16 GMT
I am just a novice and would appreciate if you can elaborate this for me.

>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
[quoted text clipped - 6 lines]
>
>Vadim Rapp
Vadim Rapp - 20 Aug 2006 13:43 GMT
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
gmenon100 - 21 Aug 2006 17:39 GMT
Thanks Vadim,

Appreciate your response. I will give it a try.

Thanks again.

>gvA> I am just a novice and would appreciate if you can elaborate this for
> gvA> me.
[quoted text clipped - 6 lines]
>
>Vadim Rapp
 
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.