John Watson
May 25th, 1999, 04:31 PM
I have a connection and recordset declared in a standard module. I want to be able to temporarily alter the recordset in a different form to narrow down the amount of data available. I tried this:
[strSource is variable storing the original SQL statement for the recordset in the standard mod.]
rst.Open strSource & " " & "WHERE State = 'MD'"
but I always get an error; if I close the original recordset first I get "cannot perform if object is closed" and if I leave it open I get "cannot perform if object is open".
I tried using the filter method for this but as I understand it recordset.filter cannot perform statements such as ("State = 'MD'" OR "State = 'DC'") AND "Last_Name = 'Jones'" --- which I need to do.
Does anyone know the proper way to alter a recordset, or if I can use the filter method somehow to do this? I'm sure the answer is easy, I just don't know it.
Thanks
John
[strSource is variable storing the original SQL statement for the recordset in the standard mod.]
rst.Open strSource & " " & "WHERE State = 'MD'"
but I always get an error; if I close the original recordset first I get "cannot perform if object is closed" and if I leave it open I get "cannot perform if object is open".
I tried using the filter method for this but as I understand it recordset.filter cannot perform statements such as ("State = 'MD'" OR "State = 'DC'") AND "Last_Name = 'Jones'" --- which I need to do.
Does anyone know the proper way to alter a recordset, or if I can use the filter method somehow to do this? I'm sure the answer is easy, I just don't know it.
Thanks
John