If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
PARAMETERS FOR STORED PROCEDURE (UPDATE, APPEND)
I use a stored procedure that is calling several other stored procedure
which update or append values in several tables. All of them are stored procedures with input parameters by which they filter rows to be updated or inserted into other tables. Filtration is based on certain actual values on forms (form with several subforms). My question is following: How to pass parameters to those stored procedures that are triggered by a button? Those stored procedures are not recordset of forms, so I can't pass it using Input Parameters property of forms (or I can?). Thanks. Zlatko |
#2
|
|||
|
|||
You've stated that the parameter values are available on forms. As long as
those form are open and the values exist on the forms at the time the stored query is run, you can tell the query to retrieve those values from the forms. This would normally be in the criteria of the query, but can be in a calculated field as well. The syntax would be Forms!frmFormName!ctlControlName Depending on the data type of the parameter, you may need to predefine the data type (this is usually needed for the Date/Time data type). To do that, open the query in design view. On the menu bar click Query|Parameters... For the name of the parameter, type in (or copy/paste in) the parameter name exactly as it appears in the query (i.e. Forms!frmFormName!ctlControlName) and choose a data type for that parameter. -- Wayne Morgan MS Access MVP "Zlatko" wrote in message ... I use a stored procedure that is calling several other stored procedure which update or append values in several tables. All of them are stored procedures with input parameters by which they filter rows to be updated or inserted into other tables. Filtration is based on certain actual values on forms (form with several subforms). My question is following: How to pass parameters to those stored procedures that are triggered by a button? Those stored procedures are not recordset of forms, so I can't pass it using Input Parameters property of forms (or I can?). |
#3
|
|||
|
|||
Yes, but it works only in .mdb, while my question is regarding .adp (Access
Projects with SQL Server)...You can't reference controls from forms in criteria directly, but only indirectly defining input parameters (@name of parameter)... "Wayne Morgan" wrote in message ... You've stated that the parameter values are available on forms. As long as those form are open and the values exist on the forms at the time the stored query is run, you can tell the query to retrieve those values from the forms. This would normally be in the criteria of the query, but can be in a calculated field as well. The syntax would be Forms!frmFormName!ctlControlName Depending on the data type of the parameter, you may need to predefine the data type (this is usually needed for the Date/Time data type). To do that, open the query in design view. On the menu bar click Query|Parameters... For the name of the parameter, type in (or copy/paste in) the parameter name exactly as it appears in the query (i.e. Forms!frmFormName!ctlControlName) and choose a data type for that parameter. -- Wayne Morgan MS Access MVP "Zlatko" wrote in message ... I use a stored procedure that is calling several other stored procedure which update or append values in several tables. All of them are stored procedures with input parameters by which they filter rows to be updated or inserted into other tables. Filtration is based on certain actual values on forms (form with several subforms). My question is following: How to pass parameters to those stored procedures that are triggered by a button? Those stored procedures are not recordset of forms, so I can't pass it using Input Parameters property of forms (or I can?). |
#4
|
|||
|
|||
Sorry, I should have caught that. I'm studying SQL Sever and .adp's now, but
I'm not that far along yet. -- Wayne Morgan MS Access MVP "Zlatko" wrote in message ... Yes, but it works only in .mdb, while my question is regarding .adp (Access Projects with SQL Server)...You can't reference controls from forms in criteria directly, but only indirectly defining input parameters (@name of parameter)... |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Update another table with a Max record query | Ngan | Running & Setting Up Queries | 2 | June 22nd, 2004 05:01 PM |
Can't update table from Form | sara | Using Forms | 3 | June 11th, 2004 02:12 PM |
Need help! Parameter update query to form | Le Tran | New Users | 7 | June 8th, 2004 06:26 PM |
Why no update? Help! | Brian | New Users | 1 | May 6th, 2004 11:15 AM |