?
Solved

Change copy - change original

Posted on 2000-03-22
8
Medium Priority
?
123 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
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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 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…
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
Course of the Month15 days, 14 hours left to enroll

741 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