Hi,
I have recently upsized an Access database to SQLServer. This has required
me rewriting the majority of the queries.
My question is this: How do I reference a control on an Access form in an
SP. (I have a query whose WHERE statement requires a value input by the user
on a form).
Many Thanks,
PeteThe SP can NOT reference a control on a form... In the form you must call
the sp passing the control's value as a parameter to the sp
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Italian Pete" <ItalianPete@.discussions.microsoft.com> wrote in message
news:4B22054F-3043-4F39-979E-C88A747A01A6@.microsoft.com...
> Hi,
> I have recently upsized an Access database to SQLServer. This has
> required
> me rewriting the majority of the queries.
> My question is this: How do I reference a control on an Access form in an
> SP. (I have a query whose WHERE statement requires a value input by the
> user
> on a form).
> Many Thanks,
> Pete|||You should be able to use a Pass-through Query from Access --> SQL - filling
the parameters on the FE and passing the query call to SQL. The sp itself
can't reference the FE controls.
"Italian Pete" wrote:
> Hi,
> I have recently upsized an Access database to SQLServer. This has requir
ed
> me rewriting the majority of the queries.
> My question is this: How do I reference a control on an Access form in an
> SP. (I have a query whose WHERE statement requires a value input by the us
er
> on a form).
> Many Thanks,
> Pete|||Wayne,
What would the syntax for passing the controls as parameters be? ( I can't
seem to find a reference to it in the Access help files).
"Wayne Snyder" wrote:
> The SP can NOT reference a control on a form... In the form you must call
> the sp passing the control's value as a parameter to the sp
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> www.mariner-usa.com
> (Please respond only to the newsgroups.)
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
> "Italian Pete" <ItalianPete@.discussions.microsoft.com> wrote in message
> news:4B22054F-3043-4F39-979E-C88A747A01A6@.microsoft.com...
>
>|||On a forms properties list (for example) is an item called "Input Parameters
"
You could put the values there, it takes some fiddling to get the order
right if you were going to use the onOpen event of the form to read in the
values from controls
eg:
Me.InputParameters = "@.a_variable a_datatype(a_length) = 'a_value'"
Me.RecordSource = "a_sproc_name"
Me.OrderByOn = True
Me.OrderBy = "a_field, another_field"
Me.UniqueTable = "table_name_to_be_updated"
real:
Me.InputParameters = "@.TYPE varchar(25) = 'My_Text'"
Me.RecordSource = "sp_Do_Some"
Me.OrderByOn = true
Me.OrderBy = "Year"
Me.UniqueTable = "tbl_Main"
"Italian Pete" wrote:
> Wayne,
> What would the syntax for passing the controls as parameters be? ( I can't
> seem to find a reference to it in the Access help files).
> "Wayne Snyder" wrote:
>
No comments:
Post a Comment