Solved

Change copy - change original

Posted on 2000-03-22
8
118 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
  • 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
ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

 

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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MsgBox 2 55
using web browser with BING 40 121
Prevent user closing word document opened with VB6 6 74
backup program with robocopy 6 19
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…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…

777 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