Marshall Brooks
Member
- Local time
- Today, 11:04
- Joined
- Feb 28, 2023
- Messages
- 727
Reference https://stackoverflow.com/questions/4228705/ms-access-update-or-cancelupdate-error-using-find-dialog
If you open the find dialog, leave the dialog open, change a field on the record, and then run the find command again, you get error 3020.
The thread mentions an AutoIt script - which I could write, but I don't want to have to deploy with my database, or creating a custom form and disabling the binoculars and Ctrl-F, but that is more than I would prefer to get involved with.
The issue is I don't know how the Find and Replace dialog is referred to in VBA. The dialog is invoked via:
DoCmd.FindRecord FindWhat:=" ", Match:=acAnywhere, MatchCase:=False, _
Search:=acSearchAll, SearchAsFormatted:=False, _
OnlyCurrentField:=acAll, FindFirst:=True
With possibly other parameters.
I'm looking for something like:
DoCmd.Close acForm, "Find and Replace"
or
Application.Dialogs(acFindReplace).Close
Not sure if this helps, but AutoHotKey WindowSpy shows the window as Title Find and Replace, ahk_class #32770, ahk_exe MSACCESS.EXE, ahk_Pid 684.
That gives me enough information to write an AHK script to close the window when the record is "Dirty", but I can't have an AHK script running in a deployed environment ...
Thanks in advance!!!
I also didn't find anything in a search for a custom Find & Replace replacement - I found this https://www.devhut.net/access-new-find-and-replace-for-developers/ - but it is designed for searching and replacing objects in VBA code windows.
If you open the find dialog, leave the dialog open, change a field on the record, and then run the find command again, you get error 3020.
The thread mentions an AutoIt script - which I could write, but I don't want to have to deploy with my database, or creating a custom form and disabling the binoculars and Ctrl-F, but that is more than I would prefer to get involved with.
The issue is I don't know how the Find and Replace dialog is referred to in VBA. The dialog is invoked via:
DoCmd.FindRecord FindWhat:=" ", Match:=acAnywhere, MatchCase:=False, _
Search:=acSearchAll, SearchAsFormatted:=False, _
OnlyCurrentField:=acAll, FindFirst:=True
With possibly other parameters.
I'm looking for something like:
DoCmd.Close acForm, "Find and Replace"
or
Application.Dialogs(acFindReplace).Close
Not sure if this helps, but AutoHotKey WindowSpy shows the window as Title Find and Replace, ahk_class #32770, ahk_exe MSACCESS.EXE, ahk_Pid 684.
That gives me enough information to write an AHK script to close the window when the record is "Dirty", but I can't have an AHK script running in a deployed environment ...
Thanks in advance!!!
I also didn't find anything in a search for a custom Find & Replace replacement - I found this https://www.devhut.net/access-new-find-and-replace-for-developers/ - but it is designed for searching and replacing objects in VBA code windows.