Results 1 to 7 of 7

Thread: Lost Form (VB6)

  1. #1
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lost Form (VB6)

    The folder I am working from for my VB project, locationesktop, seems to have lost a form.

    I had 5 forms in the folder:VBImage

    frmSplash
    Form1024PDF
    Form800PDF
    Form1024Image
    Form800Image

    When I am designing etc, I always work from a copy of this folder(Copy of VBImage), so if mistakes are made, I can just delete the working folder and revert back to the original.
    When I am happy with programming|Designs, I save the project, delete the main folder(VBImage), rename "Copy of VBImage" to "VBImage" and then copy again, giving me a working folder once again.
    The process continues.

    I've just saved some changes, gone thru the above copying procedure and now I am missing a form.
    I double checked everything and Form800Image is missing.
    The error tells me Form1 already exists.

    Has anyone ever seen this before.

    I have to completely construct the form again.
    Is it possible to copy a form and rename it ?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Lost Form (VB6)

    Your routine could be slightly simpler: instead of deleting the entire VBImage folder, just copy the contents of Copy of VBImage to VBImage, overwriting all existing files when you're satisfied with the design in Copy of VBImage.
    Another good way of storing versions of a project (if you don't want to use a professional tool such as SourceSafe) is to create zip files.

    Are you missing Form800Image from the VBImage folder, or does it not show up in VB6?

  3. #3
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Lost Form (VB6)

    Hans
    It's quite confusing.
    In the folder, there are objects which are used and not used, in this particular instance there is a BAS module not used in the project, but in the folder.
    I managed to get my form back by restoring from the recycle bin.
    I then Imported Existing form.
    Now if I delete the restored folder again, the project won't load because it can't find the form again.
    It seems, although importing, the form is relying on the old folder.

    If I make an EXE from the project, all is fine

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Lost Form (VB6)

    The.vbp file keeps track of where the bits and pieces of your project are. Perhaps it has become confused by all the moving and copying.

    One thing you might try (make a backup copy or a zip file first) is to remove all forms (right click them in the project explorer, and select Remove), then add them again (Project | Add Form, Existing tab), making sure you are adding them from the correct location.

  5. #5
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Lost Form (VB6)

    Hans
    I think I have sorted it.
    From the original folder, I renamed the forms, copied and pasted into the working folder.
    From there, right click in the project and re-instated the form.
    Fingers crossed, I'll have no more problems !!

    It seems, in the folder, the form is named Form1 and in the project: Form800Image(Form1)

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Lost Form (VB6)

    If you select the form, and look at the Properties window, you will see a (Name) property. This property is probably set to Form800Image. If you would like the file to be named Form800Image too, don't rename it in Windows Explorer - you would confuse VB6 again - but right-click the form in the Project Explorer in VB6 and select Save Form1 As... You can now save the form as Form800Image (take care to save it in the same folder as the .vbp file!)

  7. #7
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Lost Form (VB6)

    Hans
    Thanks for your attention on this problem.
    VB makes alot more sense to me now than it did a couple of weeks ago.
    I've got the forms working as they should now, I just need to recreate the graphics on the buttons now.
    The FRX files got messed around with all the copying etc.

    Have a good day.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •