Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pass globals?

Status
Not open for further replies.

aspnetuser

Technical User
Sep 9, 2004
273
0
0
US
Is it possible to pass a global string i store at user login to a view/stored procedure? I am using access project with sql 2000 as my backend.

this works fine for a form, because i set the form filter = to global variable i set at login.

how to I write that in a SP or from the report level in access project. what is the best approach for this?

 
Yes, where you call the stored procedure in the VBA code, pass the global variable as parameter.

e.g

Me.recordSource = "exec dbo.test" & globalVariable

With ADO.

dim ccn as adodb.connection
ccn = currentproject.connection
dim sql as string
sql = "exec dbo.test" & globalVariable

ccn.execute sql

or write code to capture result in recordset to populate your report.


I hope this answers your question.
 
i set a global variable at login called 301. I need to query a view using this criteria 301 before I execute my generic report so it filters by the person logging on. I could easily do this in access but in project I do not know how to. Can you provide a specifc example?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top