?
Solved

Script Control 1.0

Posted on 2003-02-25
4
Medium Priority
?
165 Views
Last Modified: 2010-08-05
Hi there,
When you add a form to a script control, does it also add the controls on the form, or do I need to add those independently?

Thanks!
Brett
0
Comment
Question by:brspurri
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 3

Accepted Solution

by:
Da_Weasel earned 200 total points
ID: 8021020
Yes, make a project with 2 forms (Form1 and Form2)
Add a Command Button (Command1) and Textbox (Text1) to Form1.
Add a Checkbox (Check1) to Form2
Add a reference to the Microsoft Scripting Control (Project>References)
Paste the following code into Form1:

Option Explicit
Dim mySC As ScriptControl

Private Sub Command1_Click()
mySC.ExecuteStatement Text1.Text
End Sub

Private Sub Form_Load()
Set mySC = New ScriptControl
mySC.Language = "VBScript"
mySC.AddObject "TheOtherForm", Form2
End Sub

run the program and type this into the textbox:
TheOtherForm.Show
click the Command1
the second for should be shown
now put this in the textbox
TheOtherForm.Check1.Value = 1
click Command1
the checkbox on Form2 should now be checked.

0
 

Expert Comment

by:CleanupPing
ID: 8901117
brspurri:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 8972885
Moderator, my recommended disposition is:

    Accept Da_Weasel's comment(s) as an answer.

DanRollins -- EE database cleanup volunteer
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

766 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question