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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass Though Queries/Stored Procedures to load combos

Status
Not open for further replies.

DonS100

Programmer
Dec 4, 2001
104
0
0
US
Hello, I have an Access 2003 application that uses SQL Server 2000 as the backend. On my invoice screen I use SQL pass though Queries to load certain combos. Before I enter the invoice screen, I refresh my pass though query using the QueryDef object. In the code below, I set it to use a stored procedure that takes a parameter of the logon user to only show customers that the user is allowed to see.

On the customer combo I set the row source to my pass though query("spLookupInvoiceClientsStaff"). This all works well but when the invoice screen is kept opened it seems to create a lock on the rows returned to populate the combo box. How can I drop the connection once the pass though query is done loading the combo.

Thanks

Don

Dim MyDB As Database

Set MyDB = DBEngine.Workspaces(0).Databases(0)

With MyDB.QueryDefs("spLookupInvoiceClientsStaff")
.SQL = "psp_InvoiceContactsStaff '" & gblSysUser & "'"
.Connect = SQLCONNECTSTRING
.ReturnsRecords = True
End With
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top