Is this possible?

J

JString

Is it possible to programatically create a new form using another as a
template?
 
F

fredg

Is it possible to programatically create a new form using another as a
template?

Sure. Just copy the existing form and change it's record source and
other changes (if you wish).

' Copy the existing form
DoCmd.CopyObject , "NewFormName", acForm, "OldFormName"

' Change it's record source to a different one.
DoCmd.OpenForm "NewFormName", acDesign, , , , acHidden
Forms!NewFormName.RecordSource = "NewRecordSource"
' Make additional form changes here.... then....
DoCmd.Close acForm, "NewFormName", acSaveYes

' Open the new form
DoCmd.OpenForm "NewFormName"
 

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