[AccessD] Macros (ugh)
Gustav Brock
gustav at cactus.dk
Sat Nov 22 01:37:55 CST 2025
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
More information about the AccessD
mailing list