First off. you will need to add a reference to the Microsoft ActiveX Data Objects library.
To create recordsets from the current DB you would use the following syntax
VB Code:
Dim rsMyRecordSet As ADODB.Recordset Dim sSQL As String Set rsMyRecordSet = New ADODB.Recordset sSQL = "SELECT field FROM table....etc" rsMyRecordSet.Open sSQL, CurrentProject.Connection
the "CurrentProject.Connection" in the above connects to the db in which your code resides.




Reply With Quote