Recordset Filter

casey

Registered User.
Local time
Today, 16:47
Joined
Dec 5, 2000
Messages
448
Hello all,

I'm trying to filter a recordset using...

Set rs = db.OpenRecordset("tblProductDetail", dbOpenDynaset)
rs.Filter = "SystemID = " & Str(Forms!frmEstimate.frmProductsAddComponents.Form.txtPID)

Can anyone tell me if filtering a recordset will work? Because I seem to be getting more records than I should. I'm not sure if I'm doing something wrong or if the "Recordset.Filter" isn't working how I anticipated.

Anyone? Beuller?
 
casey,

Are you getting all of the records in the table?

Its not quite clear, you can't be getting 40% of them.

Need more info ...

Wayne
 
Am I doing this right?

I use rs.RecordCount, but it only returns 1 where I should be getting 2 or more(I think). Do you think that filtering the recordset should give me the correct result in this case? Am I using it correctly? Thanks.
 
casey,

Oh, I thought it was a form filter.

I always use:

sql = "select * from MyTable where ..."
set rst = dbs.OpenRecordset(sql)

As for the counts, anytime I need a count
I have to do rst.MoveFirst, rst.MoveLast
and then rst.RecordCount is OK.

Wayne
 
Thanks

I'll tried setting the recordset = to the SQL and that did it. That works beautifully! Thanks for your input.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom