473,383 Members | 1,963 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Problem with Returning value from Parametrized Sp

11
Hi, I Am New in Access arena and moderate knowledge of Sql 2000 Server
Now , I'm trying to Buildup an Application with Access2003 ADP & Sql 2000 Server. Over there I create a stored procedure to return balance calculation
My Sp performs okay When I run this via Query analyzer. Problem is I can't fired this Stored procedure on Forms After update event
any one help me to solve the problem ........

Here is the Particulars

Unbound Form Name : donorbudgetadjustF

Form parameter are : CBOfiscalyear and cbocode

afterupdate control : cbocode_afterupdate

return value focus on me.txtitembalance

I have try to overcome but failed !
Expand|Select|Wrap|Line Numbers
  1. Private Sub CboCode_AfterUpdate(Cancel As Integer)
  2. Me.TxtiTemBalance.RowSource = "EXEC CodeBalance @fiscalYear= me.cbofiscalyear "
  3. Me.TxtiTemBalance.Requery
  4. End Sub

Below I Post my Sp
Expand|Select|Wrap|Line Numbers
  1. CREATE PROCEDURE DBO.CodeBalance
  2.  
  3.     @FiscalYear AS INT,
  4.     @Itemcode  AS INT
  5.  
  6. AS
  7.  
  8. SET NOCOUNT ON
  9. --SET ANSI_NULLS ON
  10. --SET QUOTED_IDENTIFIER ON
  11.  
  12.     BEGIN
  13.  
  14.  
  15.     DECLARE @inflow INT
  16.     DECLARE @outflow INT
  17.     DECLARE @credit INT
  18.     DECLARE @debit INT
  19.  
  20.     SET  @inflow=(SELECT ISNULL(SUM(Amount),0) 
  21.                                 FROM FisCalYearDonorBudgetT 
  22.                                     WHERE FisCalYear=@FiscalYear 
  23.                                         AND DACode=@Itemcode)
  24.  
  25.     SET  @outflow=(SELECT ISNULL(SUM(Amount),0) 
  26.                                 FROM DonorTranSmasterT 
  27.                                     WHERE FisCalYear=@FiscalYear 
  28.                                         AND ItemiD=@Itemcode)
  29.  
  30.     SET  @credit=(SELECT ISNULL(SUM(Credit),0) 
  31.                                 FROM DonorBudgetAdjustT 
  32.                                     WHERE FisCalYear=@FiscalYear 
  33.                                         AND ItemCr=@Itemcode)
  34.  
  35.     SET  @debit=(SELECT ISNULL(SUM(Debit),0) 
  36.                                 FROM DonorBudgetAdjustT 
  37.                                     WHERE FisCalYear=@FiscalYear 
  38.                                         AND ItemDr=@Itemcode)
  39.  
  40.     SELECT (((@inflow-@outflow)-@credit)+@debit) AS CodeBalance
  41. END
  42. GO
...............<naina>.................
Mar 3 '10 #1
3 1259
Delerna
1,134 Expert 1GB
Try changing this line on your form

Me.TxtiTemBalance.RowSource = "EXEC CodeBalance @fiscalYear= me.cbofiscalyear "


To this

Me.TxtiTemBalance.RowSource = "EXEC CodeBalance " & me.cbofiscalyear



also your stored procedure has two parameters
you must also provide a value for it .... @Itemcode
Expand|Select|Wrap|Line Numbers
  1. with Me.TxtiTemBalance
  2.    .RowSource = "EXEC CodeBalance  " _
  3.               & me.cbofiscalyear & "," & ItemCodeValue
  4. end with
  5.  
Mar 3 '10 #2
sknaina
11
Dear Delerna,


Now it works fine.
Thanks a lot for your great solution!


Naina
Mar 4 '10 #3
Delerna
1,134 Expert 1GB
You are very welcome
Mar 4 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: jslowery | last post by:
Hello, I'm new to both PostgreSQL and psycopg and I'm trying to connect to my database running on localhost. I have postgres setup to do md5 authentication and this works when using a db admin tool...
117
by: Peter Olcott | last post by:
www.halting-problem.com
1
by: andrew queisser | last post by:
I've been trying to dynamically create a class DevT that's derived from a generic base GenBase<T>. It doesn't seem to work. I'm attaching a code sample below that illustrates the problem. ...
18
by: jslowery | last post by:
I am not completely knowledgable about the status of lexical scoping in Python, but it was my understanding that this was added in a long time ago around python2.1-python2.2 I am using python2.4...
39
by: Martin Jørgensen | last post by:
Hi, I'm relatively new with C-programming and even though I've read about pointers and arrays many times, it's a topic that is a little confusing to me - at least at this moment: ---- 1)...
0
by: maxvalery | last post by:
Hi, I have a DTS package for SQL Server 2000. Its entire purpose is to 1) run a parametrized stored procedure 2) run a query 3) EXPORT parametrized stored procedure into an Excel file NAMED...
3
by: Divick | last post by:
I was reading this section in Bruce Eckel's book which talks about passing and returning large objects ( Chapter 11: References & the Copy-Constructor ), where he explains that how to return big...
8
by: John | last post by:
Hi I am using the below code to run a sql on an underlying access table; insStr = "INSERT INTO ( Action, , , Request_Date ) " & _ "VALUES (""Modify Client"", 93, ""Administrator"", Now())"...
2
by: weird0 | last post by:
Hi! On the recommendation of one of the MVP's on this group....... I tried writing parametrized queries. But the fucking thing does not work and it does not update the data in the table. I...
2
myusernotyours
by: myusernotyours | last post by:
Hi All, Am working on a Java application in which I have to use the JNI to Interface with some native code for both windows and unix. Am using netbeans IDE with the C/C++ pack installed. Am also...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.