[AccessD] Macros (ugh)

Rocky Smolin rockysmolin2 at gmail.com
Sat Nov 22 19:46:45 CST 2025


Thanks Gustav.  That's a lot cleaner way to do that than the original
programmer did it - probably back in the previous century.

So I do not get the message about macros, which is progress.  Still doesn't
find the record, though.

The Find field - case# - is a PK so long integer. . My test case has the
case# of -2144103239. I don't know how they got that big, but there it is.
Couple that have anything to do with the failure to Find?

TIA

Rocky



On Fri, Nov 21, 2025 at 11:38 PM Gustav Brock via AccessD <
accessd at databaseadvisors.com> wrote:

> Hi Rocky
>
> Don't know about the macros, but that code opens the recordset multiple
> times.
> Try being more specific and use one instance only:
>
> Dim Records As DAO.Recordset
>
> Set Records = Me.RecordsetClone
> If Records.RecordCount > 0 Then
>     Records.FindFirst "[case#] = " & Me![List283]
>     If Not Records.NoMatch Then
>         Me.Bookmark = Records..Bookmark
>     Else
>         MsgBox Me![List283] & " " & Me.List283.Column(1) & " not found."
>     End If
>     Records.Close
> End If
>
> /gustav
>
> ________________________________
> Fra: AccessD <accessd-bounces+gustav=cactus.dk at databaseadvisors.com> på
> vegne af Rocky Smolin <rockysmolin2 at gmail.com>
> Sendt: Lørdag 22 November 2025 02:43
> Til: Access Developers discussion and problem solving <
> accessd at databaseadvisors.com>
> Emne: [AccessD] Macros (ugh)
>
> Dear List:
>
> I am working with a database which was written in 97 and the client has
> only the replica. So I managed to import all of the objects into a new
> front end  and display the data entry main form which (after creating an
> abbreviated main menu) I have to get working.
>
>
> First problem was that recordsetclone does not work.  NoMatch is True.
>
> Me.RecordsetClone.FindFirst "[case#] = " & Me![List283]
> MsgBox Me.RecordsetClone.NoMatch & " " & Me![List283] & " " &
> Me.List283.Column(1)
> Me.Bookmark = Me.RecordsetClone.Bookmark
>
> where case# is an autonumber field and Me![List283]  is a list box of case
> numbers and column (1) of that list box is the client name.
>
> So I tried DoCmd.FindRecord ME![case#]
>
> But I get an error:
>
> A macro set to one of the current field's properties failed because of an
> error in a FindRecord action argument.
>
> So I deleted all the macros in the navigation pane.
>
> Same error message.
>
> Then I ran:
>
> ' Iterate through all macros in the AllMacros collection
> Set dbs = Application.CurrentProject
> For Each obj In dbs.AllMacros
> Debug.Print obj.Name ' Print macro name in Immediate Window
> Next obj
>
> and it found no macros. Which I would expect as it's looking in the Macro
> container.
>
> So where could this macro be hiding?
>
> MTIA
>
> Rocky
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> https://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>


More information about the AccessD mailing list