Access to SQL in Form

  • Thread starter Thread starter Jim Ray
  • Start date Start date
J

Jim Ray

Hello Everyone,

Thank you very much for helping me. My problem is as
follows:

1. I need to load a continuous form with data from a
stored procedure in an SQL database.
2. I have linked some of my tables to this SQL database,
however, for efficiencies sake, I would prefer to use a
stored procedure as apposed to a normal query.
3. I need to pass some parameters to the stored
procedure so that it returns the proper data.
4. For various development reasons, I am using a .mdb
not .adb file.

Thus, my question is: How do I get that SQL data into my
continuous form? Or, how do I set my form's Record
Source to that stored procedure?

Any help or direction would be greatly appreciated.

Thanks,

Jim
 
A very good resource is "Microsoft Access Developer's Guide to SQL Server"
by Mary Chipman and Andy Baron. It covers these issues and many more.
 
2. I have linked some of my tables to this SQL database,
however, for efficiencies sake, I would prefer to use a
stored procedure as apposed to a normal query.

You are not going to see any different in performance if you use a linked
table. Setup the table and use a view if you need to for sorting, and
possible other "fixed" conditions. You can then link the form direct to this
table/view.

Then, just use the "where" clause of the open form:

strInvoice = inputbox("What invoice to view?")

docmd.OpenForm "theForm",,,"InvoiceID = '" & strInvoice & "'"

Since the form will only grab the records you need..using a pass-through, or
even a stored procedure will not help one bit.
 
Back
Top