ruaridhmac
Registered User.
- Local time
- Today, 00:32
- Joined
- Nov 23, 2006
- Messages
- 10
I'm having trouble using a recordset in VBA that i have previously used without touble - the only difference is that i'm now using linked tables in SQL Server. Code as follows:
All the function is supposed to do so far is set the recordset to the query - this doesn't work and just comes up with error 91:
I've checked my referencs and there doesn't seem to be a problem there. Is there any differences i don't know about that are required when using linking tables? Or perhaps theres some setting i need to change in SQL Server - i wouldn't know what though.
Function BuildtblNodes2()
Dim db As DAO.Database
Dim rsZones As DAO.Recordset
Set db = CurrentDb
Set rsZones = db.OpenRecordset("SELECT txtZone FROM dbo.tblZone")
End Function
All the function is supposed to do so far is set the recordset to the query - this doesn't work and just comes up with error 91:
and highlights the Set rsZones line when debugging.Object Variable or With block variable not set
I've checked my referencs and there doesn't seem to be a problem there. Is there any differences i don't know about that are required when using linking tables? Or perhaps theres some setting i need to change in SQL Server - i wouldn't know what though.