I have the following code in my module
Dim rsVineyard As ADODB.Recordset
Dim mySQLVineyard As String
mySQLVineyard = "SELECT tblVineyard.VineyardName FROM tblVineyard WHERE (((tblVineyard.VineyardName)<>'na'));"
Set rsVineyard = New ADODB.Recordset
With rsVineyard
.ActiveConnection = CurrentProject.Connection
.CursorLocation = adUseServer
.CursorType = adOpenStatic
.LockType = adLockOptimistic
.Open mySQLVineyard
End With
Close
When I try to run this and use the ?rsVineyard.Fields("VineyardName") int he immediate window it says it can not find the corresponding records.
I am assuming that my sql statement is not correct.
Could someone help me out with a suggested sql statement here?
Dim rsVineyard As ADODB.Recordset
Dim mySQLVineyard As String
mySQLVineyard = "SELECT tblVineyard.VineyardName FROM tblVineyard WHERE (((tblVineyard.VineyardName)<>'na'));"
Set rsVineyard = New ADODB.Recordset
With rsVineyard
.ActiveConnection = CurrentProject.Connection
.CursorLocation = adUseServer
.CursorType = adOpenStatic
.LockType = adLockOptimistic
.Open mySQLVineyard
End With
Close
When I try to run this and use the ?rsVineyard.Fields("VineyardName") int he immediate window it says it can not find the corresponding records.
I am assuming that my sql statement is not correct.
Could someone help me out with a suggested sql statement here?