PDA

View Full Version : To specify a Form name when Creating a form on the fly with VBA and Createform



mud2
04-26-2005, 08:46 PM
When I use VBA's CreateForm(), vba autmatically checks my forms (i.e., form1, form2...) and creates the next one...i.e., form3

I want to specify the name of the created form, rather than let vba do it. ???

Killian
04-27-2005, 07:04 AM
Access doesn't seem to work this way, for example, setting a reference to the form and changing the Name property fails because it's read only.
The way to change the name in the app is to have the form as the active window and use File|Save as... but there doesn't appear to be a SaveAs method. You could attempt this by manupulating the windows, executing the menu item and using SendKeys for the filename... ugly code at best and certainly unreliable.
Strange tho it seems, it appears to me that you're stuck with Form1, Form2 etc, etc :dunno