Hello everyone,
I'm new to Tek Tips. I'm having a problem with a VBA query in Access. FIrst off, I wrote a query in design view and saved it to make sure it worked. This query pulled all the info that it shoudl have pulled. However, when i go into the code behind of a button and try to open this query. It comes up with no records. I tried it by using the one i had saved and by putting the SQL code into a string variable and running it against the string. Either way it finds no records. Here is my recordset declaration and open line:
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
rs.Open strSQL, CurrentProject.Connection, adOpenStatic, adLockOptimistic
I'm new to Tek Tips. I'm having a problem with a VBA query in Access. FIrst off, I wrote a query in design view and saved it to make sure it worked. This query pulled all the info that it shoudl have pulled. However, when i go into the code behind of a button and try to open this query. It comes up with no records. I tried it by using the one i had saved and by putting the SQL code into a string variable and running it against the string. Either way it finds no records. Here is my recordset declaration and open line:
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
rs.Open strSQL, CurrentProject.Connection, adOpenStatic, adLockOptimistic