Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recover form

Status
Not open for further replies.

BasicBoy

Programmer
Feb 22, 2008
156
ZA
My project does not want to run because there is an error on the main form, due to a system error developing while I coded the form.

The log file says :
Line 1002: Property TabPicture(2) in tabMain had an invalid file reference.

I did not have a tab picture

The code is loaded, but it does not load the form (or at least I cannot look at it) and cannot debug.

Any idea how I can fix that.

Thank you very much.
 
First off, have you tried to step through the code from the beginning to see where it errors? And if you are unable to still step you can always try the following.

first, copy the .frm file to a seperate directory.
Then right click on file and select open with.
Next, choose notepad to open the file.
If you are prompted about unicode characters do not preserve them.
Now look for messed up characters that are not supposed to be there like boxes.
If found delete them.
choose save as and if prompted about unicode characters do no preserve them and overwrite the original file.

Then if there is a .frx file associated with your .frm file copy it into the same folder as where you copied the .frm file.
Now double click on the .frm file and this should start vb in a new project.

Now if you have certain references to data access objects, FSO or other, you still may have problems loading/running the form so you may have to reference the controls/objects once again before you will be able to step through the form.

Good Luck


 
Also, while you have it open in notepad, look for line 1002 and see if there is some reference pointing to an image file. If there is a reference to an image file and it does not exist, remove reset that line as appropriate.

 
Thanks folks - I am on the right track.

A few more questions.
1. How do I read line numbers in Notepad. It has a goto (line number) function and goes to that page/line, but it does not mark the line.

2. The error I got says 'input past end' which I take to mean that there is less data to read than it should.


 
Okay, so what you are saying is that including the header information that is usually hidden from the programmer, the entire file is less than 1002 lines long. Is that correct? Have you overwritten the original file with a save as yet and tried to open the file in a new instance of VB?
 
I found a way to get to the line number.

I found the 4 references (in the .frm file) that cause the problems and removed them, without avail as it has difficulty in reading the .frx file - still giving the error : Input past end in .frx file.

The problem seems to be in the .frx file. The four lines I deleted refers to a picture for the different tabs of the sstab control. So it seems the .frm file wished to load picture path references from the .frx file and those references are not there.

I can download software to split the .frx file - which I might try.

Do you have other views ?

Thanks
 
I tried to split the .frx file, but there is nothing wrong with that file. It contains the icon and bitmap references.

If I know how to read the .frm file to see where the references are asked for in the .frx file then I think I can solve the problem.
 
Not really as my original view was that either the .frm file was saved incorrectly or that as you have found out that there were incorrect references to images. The thing is, is that you now have it working, right?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top