Saving form created on the fly

  • Thread starter Thread starter cbender
  • Start date Start date
C

cbender

I can not find a way to save a form created in code. The Name property
of the form object is read only. The Docmd.save does not allow me to
specify a name, nor have I figured out a way to use the
docmd.DoMenuItem with the acSaveFormAs constant (how would I specify
the name)?

Any tips much appreciated
Cheryl
 
Cheryl,
Hmmm... I'd be interested to know why your creating a form "on the
fly", and not just designing it.
Just curious...

Check out RunCommand constants.
There's an acCmdSaveAs, that might do the trick
DoCmd.RunCommand acCmdSaveAs

Have never used or tested that, but sounds plausible...
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
This worked for me.

Public Sub CreateMyForm(FormName)

Dim frm As Form
Dim strFormName As String

Set frm = Application.CreateForm
strFormName = frm.Name
DoCmd.Close acForm, frm.Name, acSaveYes
DoCmd.Rename FormName, acForm, strFormName

End Sub

--
HTH
Dale

email address is invalid
Please reply to newsgroup only.
 
Back
Top