cstlaurent
Board Regular
- Joined
- Jan 14, 2005
- Messages
- 182
I am using the same code serveral time with Table or Query. But it doesn't work with a specific query that is build out of 4 tables who works fine in datasheet view. I have build a table from the query and the code work just fine, just doensn't want to work directly from the query.
Set cnn = CurrentProject.Connection
Dim rs_actual As New ADODB.Recordset
rs_actual.Open "qry_Actual", cnn, adOpenStatic, adLockReadOnly
Debug.Print rs_actual.RecordCount (return -1, the actual query return 2566 records in datasheet view)
Do While Not rs_actual.EOF
Debug.Print rs_actual(1)
rs_actual.MoveNext
Loop
I have surf the web for a few hours, and didn't find anything that could help my situation. Any idea why is that happening?
Set cnn = CurrentProject.Connection
Dim rs_actual As New ADODB.Recordset
rs_actual.Open "qry_Actual", cnn, adOpenStatic, adLockReadOnly
Debug.Print rs_actual.RecordCount (return -1, the actual query return 2566 records in datasheet view)
Do While Not rs_actual.EOF
Debug.Print rs_actual(1)
rs_actual.MoveNext
Loop
I have surf the web for a few hours, and didn't find anything that could help my situation. Any idea why is that happening?