[AccessD] Goto specific record on datasheet

Ryan W wrwehler at gmail.com
Thu Jan 27 13:22:39 CST 2022


Found this to work too, maybe a little more elegant:

 With Me!SampSubReport
        .SetFocus
        With .Form.RecordsetClone
            .FindFirst "Report = TRUE"
            If Not .NoMatch Then
                Me!SampSubReport.Form.Bookmark = .Bookmark
            End If
        End With
    End With

On Thu, Jan 27, 2022 at 1:14 PM Ryan W <wrwehler at gmail.com> wrote:

> I don't often mess with seeking out a specific record programmatically, so
> I gave it a shot this morning:
>
> When you click a button, it goes to seek the first record with "Report"
> (checkbox) true:
>
> 'goto first tab
>     Me!TabCtl42 = 0
>
>     'seek out first reported dcs
>     DoCmd.GoToControl "SampSubReport"
>     Do While Not Me!SampSubReport.Form!Report
>         DoCmd.GoToRecord acActiveDataObject, , acNext
>     Loop
>
>
> This works pretty damn well.  Once it gets to the first record where
> Report is true it does what it needs to do based on that data.
>
> Just wondering if there might be a better way?
>
>
>
>
>
>


More information about the AccessD mailing list