Form to Report

  • Thread starter Thread starter google3luo359
  • Start date Start date
G

google3luo359

I'm having a few problems with my newly created Report and wonder if
someone might be able to help me troubleshoot tehm

I cloned a Form, going from Form -> Report.
My first problem is, despite setting the Report's Page view to
Landscape, when I click a button that opens the Report, it reverts to
Portrait view.

My second problem concerns two buttons which I removed from the Report.
Much to my dismay, when I later opened the Form that the Report was
cloned from, I discovered that the same two buttons were now missing
from the Form !!!

Which leads me to believe that a cloned Report (from a Form) has some
strong ties with that Form. Perhaps even a Relationship?

So how do I delete buttons from a Report and not have the same buttons
go missing on a Form?

TIA Ric
 
With your form open in design view, you choose Save As from the File menu,
and saved it as a report? As you expected, that should give you a completely
different object that is independent of the original form.

If you can open this object from the Reports tab of your database window,
and yet when you redesign it the same changes occur in another object that
appears on the Forms tab of the database window, it would seem that your
database is corrupt.

This can happen in Access 2000 and later, because these versions internally
store two lists of the objects, and it is possible for these lists to get
out of sync. Name AutoCorrect may contribute to that, but the problem is not
limited to that scenario.

The solution might be to:
1. Create a new (blank) database.

2. Uncheck the Name AutoCorrect boxes under:
Tools | Options | General

3. Import all the other objects (except this form and report):
File | Get External | Import

4. Recreate this form, and the report.
 
Allen said:
With your form open in design view, you choose Save As from the File menu,
and saved it as a report? As you expected, that should give you a completely
different object that is independent of the original form.

If you can open this object from the Reports tab of your database window,
and yet when you redesign it the same changes occur in another object that
appears on the Forms tab of the database window, it would seem that your
database is corrupt.

Yes that's exactly what I did.

This can happen in Access 2000 and later, because these versions internally
store two lists of the objects, and it is possible for these lists to get
out of sync. Name AutoCorrect may contribute to that, but the problem is not
limited to that scenario.

I'm using ccess 2000.


The solution might be to:
4. Recreate this form, and the report.

Ouch. (Man this Google box is really screwed up, won't allow an
exclamation mark)
This form is the most complicated in my whole db. Took hours to create.
:(
Hmmmmm..
For the time being, I just decided to leave the two controls on the
Report, and not delete them. It's not a big deal having them there.

Thanks! Ric
 
Another way to try to rescue the form is to use the undocumented SaveAsText
and LoadFormText.

For example, you export it from your database with:
SaveAsText acForm, "Form1", "c:\form1.txt"
Then in the new database:
LoadFromText acForm, "Form1", "c:\form1.txt"

If that works, you are laughing. If it fails, there really is a bad
corruption with the form.
 
Allen said:
Another way to try to rescue the form is to use the undocumented SaveAsText
and LoadFormText.

For example, you export it from your database with:
SaveAsText acForm, "Form1", "c:\form1.txt"
Then in the new database:
LoadFromText acForm, "Form1", "c:\form1.txt"

If that works, you are laughing. If it fails, there really is a bad
corruption with the form.


Thanks Allen.
Perhaps the following info will give you more insight as to what is
really happening with my db.

I went back to an earlier version of my db (before I made the Form ->
Report)
I went through the Form -> Report steps.
This time I noticed a confirmation box pop up asking me if I wanted the
changes to be made to fmTab09, fmTab10, fmTab11, and fmTab12 (as I was
OKing the finalization of the Report.

My form is tabbed and has a subform.

I don't recall having OKed the above changes to my forms, but I may
have inadvertantly done so.
*This time* I didn't OK the changes and lo and behold, the report did
not go through with the change either! It seems it must be an all or
nothing change!

Does it make any more sense to you now?

TIA Ric
 
No. That makes no sense to me, unless you had some unsaved changes that had
to be ok'd before it could be saved in another format. I suspect something
is amiss (possibly corrupt.)

Suggested sequence:
1. Make sure that Name AutoCorrect is off.
2. Compact.
3. Decompile.
4. Compact again.
5. Export the form (SaveAsText.)
6. Create new database.
7. Turn of Name AutoCorrect in new database.
8. Import the other objects.
9. Use LoadFromText to get this form in.
 
Allen said:
No. That makes no sense to me, unless you had some unsaved changes that had
to be ok'd before it could be saved in another format. I suspect something
is amiss (possibly corrupt.)

Suggested sequence:
1. Make sure that Name AutoCorrect is off.
2. Compact.
3. Decompile.
4. Compact again.
5. Export the form (SaveAsText.)
6. Create new database.
7. Turn of Name AutoCorrect in new database.
8. Import the other objects.
9. Use LoadFromText to get this form in.


Hi Allen,

On step 5. I'm supposed to go:
File/Export/Save as Type: .txt file?

When I do that the file saves to 0 bytes. Not good.

Where do I find 'LoadFromText' in Access?

TIA Ric
 
No, SaveAsText is an undocumented VBA command, and it is not available
through the menus.

Press Ctrl+G to open the immediate window.
Enter the command there, as shown previously:
SaveAsText acForm, "Form1", "c:\form1.txt"
replacing the Form1 with the name of your form. (The file name can be
anything .txt.) This creates a text file on your drive that has all the
properties of this form.

Then in the new database, press Ctrl+G and enter the matching undocumented
command to import the form from the text file.

If there is a drastic corruption in the form, the SaveAsText usually fails.
If not, this can rescue the form for you--particularly where Access is just
confused about it.
 
Allen said:
No. That makes no sense to me, unless you had some unsaved changes that had
to be ok'd before it could be saved in another format. I suspect something
is amiss (possibly corrupt.)

Suggested sequence:
1. Make sure that Name AutoCorrect is off.
2. Compact.
3. Decompile.
4. Compact again.
5. Export the form (SaveAsText.)
6. Create new database.
7. Turn of Name AutoCorrect in new database.
8. Import the other objects.
9. Use LoadFromText to get this form in.


Hi Allen,

Although I'm now using a much later version of my db, and some
re-designed tables, I had some time to go back and try out your
suggestion from above (9-step process).
I went back to the version that I was using at the time (my fmAEP has
remained quite similar in design, visually, since then).

I was able to complete all steps without a hitch.

So now it was time to go back and try to make a new report from the
same old form.
I used the proper steps. File/SaveAs/ Save Form as Report etc.

OK. So I open the *new report* and go in to try and delete some
controls on one of the subforms. I delete them and as I'm closing the
report I'm asked "Do you want to save the changes to *form* fmAEP,
Yes, No, Cancel?"
(I have added the asterisks for emphasis).

What are your thoughts now?
Have you tried making changes as I have with the same circumstances?
A report generated from a form with a tab control and a bunch of
subforms?

TIA Ric
 
I didn't follow that at all.

There is no mechanism for deleting records from a report, so if you are
deleting records from something, it cannot be a report.
 
Allen said:
I didn't follow that at all.

There is no mechanism for deleting records from a report, so if you are
deleting records from something, it cannot be a report.


Hi Allen. I didn't mention deleting 'records'.
I was talking about 'controls' on a subform.

I have pasted what I said:

TIA Ric
 
Ah, you are deleting controls in design view. Of course.

So you saved the main form as a report. The form had a subform on it.
After saving as a report, the report still has the *subform* in it.
Hence, if you change it, you are actually changing the original subform.

You could avoid that by opening the subform directly from the database
window, and choose Save As ... Report. Close. Then open the new report in
design view, right-click the edge of the subform/subreport contorl, and
choose Properties. Change the SourceObject property so it is using the new
report you just saved, instead of the original subform.

Now you have a subreport on your report, instead of the subform on your
report.
 
Allen said:
Ah, you are deleting controls in design view. Of course. .......
Now you have a subreport on your report, instead of the subform on your
report.

Thanks Allen, it's all finally making sense.
Ric
 
Back
Top