Unable to extract records filtered in a datasheet - Access 2010

R

rawdon

Hello

I am using the Access 2010 datasheet on a form, which allows the user to se
al
kinds of sorting and filtering. When they click a button I need to build
recordset that contains only the records that meet the filter criteria a
specified in the datasheet

If I try Form.RecordsetClone then I get the datasheet's original recordset bu
NOT filtered

Any ideas

Thank you in advance
Rawdon
 
S

Stuart McCall

rawdon said:
Hello,

I am using the Access 2010 datasheet on a form, which allows the user to
set
all
kinds of sorting and filtering. When they click a button I need to build
a
recordset that contains only the records that meet the filter criteria as
specified in the datasheet.

If I try Form.RecordsetClone then I get the datasheet's original recordset
but
NOT filtered.

Any ideas?

Thank you in advance.
Rawdon

Set rs = CurrentDb.OpenRecordset(Me.RecordSource)
rs.Filter = Me.Filter
rs.Sort = Me.OrderBy

(Untested)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top