As a veteran VBA programmer in Excel, you would notice that when you type the
space after DoCmd.OpenForm, intellisense quite clearly notifies you that the
only required argument is for the form name. And the variable stLinkCriteria
(which is optional) is never set in the example you show, so you can delete
that line right out. And then you should know also that you can hardcode the
form name rather than storing it in the stDocName variable, so then you can
get rid of those two lines. Which leaves you with one line:
DoCmd.OpenForm "frmFindFiles"
For someone who's developed a number of major applications using VBA in
excel, you don't seem to be putting much effort into this in Access. Looking
at a function and Intellisense's argument list is pretty basic to any VBA,
regardless of the host application. So the only thing to learn here is to
use the DoCmd.OpenForm method rather an MyForm.Show
Use your imagination a little and try to read between the lines when you
pull something out of a book (or the help files)...
--
Jack Leach
www.tristatemachine.com
"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)