Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dynamic form creation, how to name, display and destroy? 2

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
Hi,

I am trying to dynamically create a form , all is going well except I don't seem to be able to name the form , nor display it in form view and clearing the object referencing the form doesn't destroy it either?

I have
Code:
    Dim cTxt As Control
    Dim fForm As Form
    
    ' set up form
    Set fForm = CreateForm
    fForm.Caption = "Email Progress Information"
    fForm.Width = 200
    fForm.Section(0).Height = 200
    fForm.InsideHeight = 200
    fForm.NavigationButtons = False
    fForm.DefaultView = acNormal
    fForm.ScrollBars = 0
    fForm.RecordSelectors = False
    fForm.AutoResize = True
    fForm.AutoCenter = True
    fForm.PopUp = True
    fForm.FitToScreen = False
    
    ' add text box
    Set cTxt = CreateControl(fForm.Name, acTextBox)
    With cTxt
        .Properties("Width") = 5000
        .Properties("Height") = 2000
        .Properties("Name") = "Progress"
    End With

But if I try to use fFrom.Name = "XYZ" it errors saying it is a read only property?

So how do I name the form , also how do I switch from design view into form view?

I basically want this form to only be in existence until I clear the object pointing to it, is this possible?

Or do I have to save the form, open it and delete it when I'm done?

I simply want to have a progress window for a specific class, that is only around for the life of that class object.

Help finalising this is appreciated.

Regards,

1DMF

"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

Free Dance Music Downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top