I have 2 databases BD1 and DB2
I open DB1 and Try to return the results from querying DB2
I can message out the data which shows that the query works in so far as it is in memory
the problem is I want to display the records on a form but this is proving difficult
Please see below
Dim Dbs_Database As DAO.Database
dIM strSQL as String
Dim rst(1 To 3) As DAO.Recordset
Set Dbs_Database = OpenDatabase("C:\DB\MYDB.mdb")
strSQL = "Select * From tblOne;"
Set rst(1) = Dbs_Database.OpenRecordset(strSQL)
MsgBox (rst(1)![Persons Name]) OK message works
MsgBox (rst(1).Fields(0).Name) OK message works
(I can also loop through the records to meg out every record)
Me.RecordSource = strSQL 'Error the recordsource "Select * From tblOne" does not exist
Me.RecordSource = rst(1) 'Error "Type mismatch"
Can this be achieved?
Thanks
I open DB1 and Try to return the results from querying DB2
I can message out the data which shows that the query works in so far as it is in memory
the problem is I want to display the records on a form but this is proving difficult
Please see below
Dim Dbs_Database As DAO.Database
dIM strSQL as String
Dim rst(1 To 3) As DAO.Recordset
Set Dbs_Database = OpenDatabase("C:\DB\MYDB.mdb")
strSQL = "Select * From tblOne;"
Set rst(1) = Dbs_Database.OpenRecordset(strSQL)
MsgBox (rst(1)![Persons Name]) OK message works
MsgBox (rst(1).Fields(0).Name) OK message works
(I can also loop through the records to meg out every record)
Me.RecordSource = strSQL 'Error the recordsource "Select * From tblOne" does not exist
Me.RecordSource = rst(1) 'Error "Type mismatch"
Can this be achieved?
Thanks