[AccessD] Selecting Filtered records in Datasheet

Stuart McLachlan stuart at lexacorp.com.pg
Sun Jun 5 21:42:23 CDT 2016


The key to this is the last sentence of the Help entry fro RecordsetClone:

The RecordsetClone property setting is a copy of the underlying query or table 
specified by the form's RecordSource property. If a form is based on a query, for 
example, referring to the RecordsetClone property is the equivalent of cloning a 
Recordset object by using the same query. If you then apply a filter to the form, the 
Recordset object reflects the filtering.

-- 
Stuart

On 6 Jun 2016 at 12:06, Stuart McLachlan wrote:

> Couldn't find an old example, so I just knocked this up.  It does what
> you want - just updates the currently displayed records.
> 
> Private Sub Command8_Click()
> Dim rs As DAO.Recordset
> Set rs = Me.RecordsetClone
> rs.MoveFirst
> While Not rs.EOF
>    rs.Edit
>    rs!chk = True
>    rs.Update
>     rs.MoveNext
> Wend
> 
> End Sub
> 
> 
> On 6 Jun 2016 at 9:46, Stuart McLachlan wrote:
> 
> > Not as far as I know,  but I've done a similar thing before by just
> > stepping through  the filtered recordset and setting each one in
> > turn.
> >  I'll see if I can dig up an example.
> > 
> > 
> > 
> > On 6 Jun 2016 at 11:26, David Emerson wrote:
> > 
> > > Hi Listers,
> > > 
> > > I have a form that is displayed in Datasheet view.  The records
> > > can be filtered using the built in filtering menus.
> > > 
> > > I want to be able to identify the records that are showing so that
> > > I can update a field (specifically setting a yes/no field to
> > > true). Is there a property or method that will let me know which
> > > records are left when filtering is applied on a datasheet?
> > > 
> > > Regards
> > > 
> > > David Emerson
> > > Dalyn Software Ltd
> > > Wellington, New Zealand
> > > 
> > > 
> > > 
> > > 
> > > -- 
> > > AccessD mailing list
> > > AccessD at databaseadvisors.com
> > > http://databaseadvisors.com/mailman/listinfo/accessd
> > > Website: http://www.databaseadvisors.com
> > > 
> > 
> > 
> > -- 
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> > 
> 
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 




More information about the AccessD mailing list