Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Change copy - change original

Posted on 2000-03-22
8
Medium Priority
?
126 Views
Last Modified: 2010-05-02
The problem I am having seems ...  See for yourself:
I made copies of the various parts of VB project(modules, forms) into another directory on the network, with the same names.
When I made modifications to the copy and than checked the original versions, I noted that it changed also. Why is that? Thanks.
0
Comment
Question by:GinaP
[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
  • 3
  • 3
  • 2
8 Comments
 
LVL 14

Accepted Solution

by:
mcrider earned 200 total points
ID: 2645005
When you add forms and modules from one project to another, and you make changes to the form or module, the change WILL be in BOTH projects.  This is how VB is designed to operate.

If you want to add a form or module from another project, and you dont want this to happen:

1) Load the form or module from the old project into your new project.

2) Right-click on the form or project from the "project box" and select "Save As..." and save the item to a new file...


Cheers!®©
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 2645142
Yep. Basically you've got two VB projects X:\Y\Z\A.vbp and Q:\R\S\B.vbp, but both of them are using the file (e.g.) K:\L\M\N.frm

So you go into A.vbp, make changes to the form, i.e. K:\L\M\N.frm and hey presto...

You didn't make a copy; you have two different projects pointing at the same source file.
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 2645157
There is one easy way to avoid this problem. Always have the .vbp and all associated files in the *same* directory.

If you open your .vbp in Notepad you'll see that if your .vbp is A:\B\C.vbp and it references a form D:\E\F.frm that there is a reference in the vbp to D:\E\F.frm

If however the form is in the SAME directory A:\B\G.frm for example, the reference in the .vbp file will simply be G.frm

Then, if you copy the whole lot to another directory H:\I\J for example, it won't cause a problem because the reference to G.frm in H:\I\J\C.vbp will now implicitly point to the new copy H:\I\J\G.frm and not to the original A:\B\G.frm

Or something..
0
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.

 

Author Comment

by:GinaP
ID: 2645365
Does it means that when I go to windows explorer, select directory (which contain .vbp, .frm, and all the parts of my project) and make copy of all and than place this copy into a new directory, it is not a copy, but a pointer to the same files( because this is what I did)?
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2645392
It IS a copy, however, look at the .VBP in notepad... It's just text. You will see that the VBP contains lines that point to the ORIGINAL project, not the copy...


Cheers!®©
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 2645413
eggs-ACT-ley
0
 

Author Comment

by:GinaP
ID: 2645458
Yes, that is correct. Thank you.
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2645744
Thanks for the points! Glad I could help!


Cheers!®©
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

618 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