patriciaxxx
Programmer
I have the following sub in an Access module which creates a simple UserForm and then displays it. However when you close the form and exit the datadbase it then promps you to save the form. This is no good.
I need the code to save the form.
How do you do this within the code?
I need the code to save the form.
How do you do this within the code?
Code:
[COLOR=#204A87]Public Sub AddControls()
Dim MyNewForm As VBComponent
Dim myCheckBox As MSForms.Control
Set MyNewForm = Application.VBE.ActiveVBProject.VBComponents.Add(vbext_ct_MSForm)
Set myCheckBox = MyNewForm.Designer.Controls.Add("Forms.CheckBox.1")
With myCheckBox
.Name = "Check1"
.Caption = "Check here"
.Left = 10
.Top = 10
.Height = 20
.Width = 60
End With
[COLOR=#4E9A06]'...something here to save the UserForm[/color]
UserForms.Add(MyNewForm.Name).Show
[COLOR=#4E9A06]'...or here[/color]
End Sub
[/color]