Stored Procedure, Forms and Input Parameters

M

Mat Child

Hi,
I have a DB that has long ago needed to move it's data to an SQL server
instead of using an MDB file.
Before i go anywhere near the live DB i'm experimenting on how to do this.
The method i'm currently exploring is to use an Access 2007 Project
connected to SQL server 2005.

Currently I'm working on binding form to a Stored Procedure.

Selecting the SP in the form's record source works so far as when the form
opens an input box is displayed for my paramter (SelDB). Enter a valid value
and the data is displayed on the form as expected.

Is there a straightforward way of specifying the paramter (say within VBA
when opening the form) without the input box. So that the code could take the
value from a currently selected record on another form.

Previously I used VBA functions in an access query that would reference the
value I wanted.

Any help would be most appreciated
 
P

Paul Shapiro

Mat Child said:
Hi,
I have a DB that has long ago needed to move it's data to an SQL server
instead of using an MDB file.
Before i go anywhere near the live DB i'm experimenting on how to do this.
The method i'm currently exploring is to use an Access 2007 Project
connected to SQL server 2005.

Currently I'm working on binding form to a Stored Procedure.

Selecting the SP in the form's record source works so far as when the form
opens an input box is displayed for my paramter (SelDB). Enter a valid
value
and the data is displayed on the form as expected.

Is there a straightforward way of specifying the paramter (say within VBA
when opening the form) without the input box. So that the code could take
the
value from a currently selected record on another form.

Previously I used VBA functions in an access query that would reference
the
value I wanted.

Searching found
http://p2p.wrox.com/access-vba/8718-access-forms-open-method-passing-parameters.html
which suggests:
Having something along the lines of:
@Parm1 = Forms!frm.txt1, @Parm2 = Forms!frm.txt2, @Parm3 =
Forms!frm.txt3
in your form's InputParameters property usually works. If you're trying to
pass calculated values, then calculate them on your form in hidden text
boxes.
 
M

Mat Child

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