parameters and subforms

  • Thread starter Thread starter Britta
  • Start date Start date
B

Britta

Hi there,
I have some newbie questions on adp:
I use an Access 2000 front end with a MS-SQL Backend

I have created a subform using the subform/subreport control in the
detail-section of the form.
This subform gets its data from a stored procedure.

So far so good, but I need to supply the sproc with parameters (not
one but several).

I´ve done some research, and have found that I´m supposed to write the
parameters into the PropertiesBox (InputParameters)

Unfortunately the PropertiesBox of my subform does not supply me with
a field "InputParameters" in which to state my parameters.

How do I tell access to use parameters for my sproc?


My aim is to take the user input from a form in a seperate window and
use these as the parameters of my sproc. I then want to requery the
subform with the new parameters.

Any ideas?
Help would be greatly appreciated!
Thanks,
Britta.
 
Ok,
after some further research (and I´m hoping I´m making any sense here)
I have tried this in a Public Sub. I supply the public sub with
parameters which I want to use as parameters for my stored pocedure.
<snippet>
Dim cmd As New ADODB.Command
Dim rst As New ADODB.Recordset

With cmd
.ActiveConnection = CurrentProject.Connection
.CommandType = adCmdStoredProc
.CommandText = "spverw_getUebersichtSuchergebnis"
.Parameters.Append .CreateParameter("@suchbegriff", adVarChar,
adParamInput, 50)
.Parameters.Append .CreateParameter("@suchfelder", adVarChar,
adParamInput, 50)
.Parameters.Append .CreateParameter("@vonDatum", adVarChar,
adParamInput, 50)
.Parameters.Append .CreateParameter("@bisDatum", adVarChar,
adParamInput, 50)
.Parameters.Append .CreateParameter("@datumtyp", adVarChar,
adParamInput, 50)
.Parameters.Append .CreateParameter("@status", adVarChar,
adParamInput, 50)
.Parameters.Append .CreateParameter("@mitglieder", adVarChar,
adParamInput, 100)

.Parameters("@suchbegriff") = mySuchbegriff
.Parameters("@suchfelder") = mySuchfelder
.Parameters("@vonDatum") = myVonDatum
.Parameters("@bisDatum") = myBisDatum
.Parameters("@datumtyp") = myDatumtyp
.Parameters("@status") = myStatus
.Parameters("@mitglieder") = myMitglieder

.Parameters.Refresh
.Execute
End With

'ufrmSuchergebnis is the name of my subform/subreport
ufrmSuchergebnis.Requery
</snippet>

Of course the requery only reruns the sproc I´ve given in the
properties box (in which I cannot set any input parameters).
What I want to do, is assign the ado recordset to the
subform/subreport ufrmSuchergebnis. This does not work, since the
object subform/subreport does not support Recordset.

I´ve found some references to solutions using pass-through queries,
but from what I gather these are .mdb only.


I´m totally stumped, desperate and in need of help.

Anyone?

Britta.
 
Back
Top