FindRecord in Macro does not return Not Found error

H

huzefahashim

Hi,
I am designing a database where I can input data in a form and the
macro searches for that data in a particular field and then moves
focus to another field where it inputs pre-defined data.
The only problem is, if the particular search fails, there is no
notification. Instead, it moves on and inputs the pre-defined data in
the last record which had the focus.
I want the macro to return a popup box with the error and close the
macro.
What should I do?
Thanks!
Zef.
 
J

Jerry Whittle

On problem with macros (at least the pre-A07 versions) is the lack of error
handling. For that you need a function if returing records.

Got to Macros in the database window. Click once on the Macro in question.
Go to File, Save As on the menu. On the first dialog box change the dropdown
with Macro in it to Module. Follow the prompts. That will convert your Macro
to a function within a module.

I'm not much of a code so possibly someone else could help you with the
actual code changes. Maybe even over in the Module Coding area.
 
Top