M
Mark Hanford
I have a database in which a VBA procedure uses a query to get a list of
contact info to process. The problem is that the query when called in the
code is returning different records to those returned by opening the query
in the user interface:
a snippet of code is:
SQL = "SELECT * FROM ModifyADSLXcontacts"
RS.Open SQL, CurrentProject.Connection
Do Until RS.EOF
Debug.Print rs.Fields("GivenName")
Debug.Print rs.Fields("SN")
Debug.Print rs.Fields("email")
RS.MoveNext
Loop
RS.Close
And this will return the first record as "Dan Smith [email protected]"
If I just open the query in access, he is nowhere in the recordset. There
are no non-deterministic elements in the query, no functions (appart from
Len())
Any ideas? I hope I'm just missing something obvious here...
contact info to process. The problem is that the query when called in the
code is returning different records to those returned by opening the query
in the user interface:
a snippet of code is:
SQL = "SELECT * FROM ModifyADSLXcontacts"
RS.Open SQL, CurrentProject.Connection
Do Until RS.EOF
Debug.Print rs.Fields("GivenName")
Debug.Print rs.Fields("SN")
Debug.Print rs.Fields("email")
RS.MoveNext
Loop
RS.Close
And this will return the first record as "Dan Smith [email protected]"
If I just open the query in access, he is nowhere in the recordset. There
are no non-deterministic elements in the query, no functions (appart from
Len())
Any ideas? I hope I'm just missing something obvious here...