Renaming a programatically created form

G

gabor123

Hi!

I created a form from VB code and when it is finished I want to rename it
(to change the default name Access gave it).
I only could do it by selecting the new object in the database window
DoCmd.SelectObject acForm, <Access generated name>, True
DoCmd.Rename <new name>
But this has several disadvantages:
Flashes the screen, bring the database window to visible (even it was
hided), etc.

Thank you for your help!

Gabor
 
A

Allen Browne

SelectObject is not needed. Just:
DoCmd.Rename "MyNewName", acForm, "Form1"

If that still bothers you, you could experiment with Echo off.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top