?
Solved

how could i access a form created using instance by code?

Posted on 2001-06-27
5
Medium Priority
?
141 Views
Last Modified: 2010-05-02
I have created an mdiform containing a new menu.in this i create an instance of another form which contains a text box.every time i click i get a new instance of the form. i save the text in the text box using Activeform property in a random file.say i have 4 instances of the same form if i quit the app i rise a question to save the text in a file.i could only save the active form's text for no of times the instance of the form is created.how could i access the remaining 3 forms and save it?
0
Comment
Question by:GaneshDevx
[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
5 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 300 total points
ID: 6231275
If you use the Forms collection you can do this:

On Error Resume Next
Open "MyFile" For Output As #1
For Each MyForm In Forms
  Print MyForm.Text1.Text
Next

This is just the simplest version, you should add some additional verification in case you have other forms which do not have the same control. In this way you would also write the value for the activeform so you could do away with that part of your code.
0
 
LVL 53

Expert Comment

by:Ryan Chong
ID: 6231295
Hi,

When quit the program:

Do while <ActiveForm is not nothing>
   <Save value to your file>
   <Close the current form>
loop
0
 
LVL 1

Expert Comment

by:HelixDaKat
ID: 6232102
In the form tht has the textbox add a Property that indicates that the contents of the box have changed.

In the unload event of the form add code to prompt the user to save the modified information.

This way you will always get a prompt when ever the user changes anything on anyform.

So if the user changes the values of windows 1,2, & 4. The user will be prompt 3 times to save the information.

HDK
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7139894
Hi GaneshDevx,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will suggest to:

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

GaneshDevx, if you think your question was not answered at all or if you need help, you can simply post a new comment here.  Community Support moderators will follow up.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Expert Comment

by:Computer101
ID: 7178851
Comment from expert accepted as answer

Computer101
E-E Moderator
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

801 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