Question Locked

Subform in MS Access not displayed

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I have a form with a subform embedded. I can see the information that is populated into the subform from form view but not print preview. I cantI have not made any changes to the settings so I am not sure why my subform is not displaying. Any help would be greatly appreciated!

5 replies

by peconet tietokoneet

SYMPTOMS:
Novice: Requires knowledge of the user interface on single-user computers.

When you preview a form that contains a subform, the subform area is blank. However, you can see the subform control when you open the main form in Design view.

CAUSE:
If you have a subform that does not contain any data, the subform appears in Form view with the structure only. However, no part of the subform is visible when you preview the form.

This behavior also occurs if the DataEntry property of the subform is set to Yes (or if its DefaultEditing property is set to Data Entry in versions 1.x and 2.0). When you preview a form, you are opening it; because the subform is opening in Data Entry mode, it does not contain any data.

MORE INFORMATION:
Steps to Reproduce Behavior
CAUTION: Following the steps in this example will modify the sample database Northwind.mdb (or NWIND.MDB in version 2.0 or earlier). You may want to back up the Northwind.mdb (or NWIND.MDB) file and perform these steps on a copy of the database.

1. Open the sample database Northwind.mdb (or NWIND.MDB in versions 1.x and 2.0).
2. Open the Orders Subform in Design view.
3. In Microsoft Access 7.0 and 97, set the form's DataEntry property to Yes.

In Microsoft Access 1.x and 2.0, set the form's DefaultEditing property to Data Entry.
4. Save the form and close it.
5. Open the Orders form in Form view. Note the appearance of the Orders Subform on the form.
6. Open the Orders form in Print Preview. Note that the portion of the form containing the Orders Subform is blank.

Print preview, as executed by this vba line of code:
DoCmd.RunCommand acCmdPrintPreview
does show form and subform, however all records are displayed.
If you want to restrict which records show from those currently available in your main form, use a query / report approach.
A report allows for better format and display control.

by khale

That did it! Thank you sooo much! I have literally been working on this for 8 hours trying to retrace my steps and figure out what I had done wrong! It was the main form that was set for data entry. The subform was not set for data entry. I thank you from the bottom of my sleepless heart!

by peconet tietokoneet

Nice to know it has sorted it out for you.

Please post back if have any more problems or questions.

by jer12

I have the same proble. I cant get my subform to print, also how do i get it to print only the current record that is on the screen??

This discussion is closed to new replies.