PARAMETERS FOR STORED PROCEDURE (UPDATE, APPEND)

Z

Zlatko

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
 
W

Wayne Morgan

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.
 
Z

Zlatko

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)...
 
W

Wayne Morgan

Sorry, I should have caught that. I'm studying SQL Sever and .adp's now, but
I'm not that far along yet.
 

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