Author Topic: Example code ( userform, module )  (Read 4355 times)

0 Members and 1 Guest are viewing this topic.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Example code ( userform, module )
« Reply #15 on: October 17, 2006, 12:09:09 PM »
Try this Mark --

Code: [Select]
Public Sub RunMe()
   
    Dim myFormInstance As MyForm
    Set myFormInstance = New MyForm
   
    With myFormInstance
        .Label1.Caption = "A caption."
        .TextBoxMsg.Text = "Some text."
    End With
   
    myFormInstance.Show
    Unload myFormInstance
   
End Sub
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Arizona

  • Guest
Re: Example code ( userform, module )
« Reply #16 on: October 17, 2006, 12:09:40 PM »
Since you are already displaying the form I believe you need to do a "refresh"

Or put the show form statement under the textbox statements

Never mind...I like Michael's answer better! :-)
« Last Edit: October 17, 2006, 12:11:11 PM by Arizona »

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Re: Example code ( userform, module )
« Reply #17 on: October 17, 2006, 12:10:01 PM »
question, is MyForm part of the dvb that contains RunMe?  if so, you shouldn't have to load it.
2nd thing - I dont know why it doesn't work.  I will go test it

1) yes
2) OK, thanks.

screen shot coming ....
TheSwamp.org  (serving the CAD community since 2003)