How do I open following recordset below in a datasheet view programatically?
I also ran into problem when selecting which table/query to use in the SELECT statement. For some reason qryCustomerData works fine, but another table or query I have doesn't. Both open fine in a datasheet view when I manually Open them. (And both contain various calculated fields.)
I also ran into problem when selecting which table/query to use in the SELECT statement. For some reason qryCustomerData works fine, but another table or query I have doesn't. Both open fine in a datasheet view when I manually Open them. (And both contain various calculated fields.)
Private Sub Button_Click()
Dim dbs As Database, rst As Recordset, strSQL As String
strSQL = "SELECT * FROM qryCustomerData"
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset(strSQL, dbOpenSnapshot, dbReadOnly)
rst.RecordCount
rst.Close
End Sub