Solved

Change copy - change original

Posted on 2000-03-22
8
120 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 50 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
Industry Leaders: 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!

 

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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 process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

730 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