Solved

Change copy - change original

Posted on 2000-03-22
8
115 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 

Author Comment

by:GinaP
Comment Utility
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 14

Expert Comment

by:mcrider
Comment Utility
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
Comment Utility
eggs-ACT-ley
0
 

Author Comment

by:GinaP
Comment Utility
Yes, that is correct. Thank you.
0
 
LVL 14

Expert Comment

by:mcrider
Comment Utility
Thanks for the points! Glad I could help!


Cheers!®©
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now