SubForm not visible on Main Form using Access 2003

T

Tylendal

When the main form opens it has the customerID and CustomerName displayed.
The subForm uses a query to pull data from a table using the CustomerID on
the main form.

The subForm does not appear. It's visibilty is set to true. When I open
the subForm seperately it opens with the correct data based on the CustomerID
from the Main Form.

The subForm is part of the Detail section of the main form and the detail
visibility is set to true.

Appreciate assistance.
Fred Alyea
(e-mail address removed)

I moved the subForm into the Header Section on a lark and when I open the
form the subForm is displayed. Not sure what this means as im stumbling over
something I have used dozens of times without a problem.
 
M

Marshall Barton

Tylendal said:
When the main form opens it has the customerID and CustomerName displayed.
The subForm uses a query to pull data from a table using the CustomerID on
the main form.

The subForm does not appear. It's visibilty is set to true. When I open
the subForm seperately it opens with the correct data based on the CustomerID
from the Main Form.

The subForm is part of the Detail section of the main form and the detail
visibility is set to true.

I moved the subForm into the Header Section on a lark and when I open the
form the subForm is displayed. Not sure what this means as im stumbling over
something I have used dozens of times without a problem.

Not sure what that means either. The reason subforms do not
appear is almost always because it has no records to display
and the AllowAdditions property is set to No/False.

In general, a subform's record source query should not use a
criteria to a main form control. Instead it is preferable
to use the Link Master/Child Fields properties.
 
T

Tylendal

Marshall Barton said:
Not sure what that means either. The reason subforms do not
appear is almost always because it has no records to display
and the AllowAdditions property is set to No/False.

In general, a subform's record source query should not use a
criteria to a main form control. Instead it is preferable
to use the Link Master/Child Fields properties.

I have use Link Master/Chields properties but makes no difference. The
subForm is still not visible. What I dont understand is why if I place the
subForm in the Form Header area it opens. Also, if I just ope the subForm
seperately it open also. Both the Header area and seperately opening show
the correct data associated with the customerID. I'm stumped!!!

Fred Alyea
(e-mail address removed)
 
M

Marshall Barton

Tylendal said:
I have use Link Master/Chields properties but makes no difference. The
subForm is still not visible. What I dont understand is why if I place the
subForm in the Form Header area it opens. Also, if I just ope the subForm
seperately it open also. Both the Header area and seperately opening show
the correct data associated with the customerID. I'm stumped!!!


I don't see why it would work in the header and not in the
detail either.

Just shooting in the dark now. Maybe you have some code
that's doing something funny or maybe the Criteria and Link
peoperties are clashing?

All I can suggest is to do some debugging with strategically
place breakpoints or Debug.Print statements and checking the
properties of everything related to the subform and its main
form subform control.
 
T

Tylendal

Tylendal said:
When the main form opens it has the customerID and CustomerName displayed.
The subForm uses a query to pull data from a table using the CustomerID on
the main form.

The subForm does not appear. It's visibilty is set to true. When I open
the subForm seperately it opens with the correct data based on the CustomerID
from the Main Form.

The subForm is part of the Detail section of the main form and the detail
visibility is set to true.

Appreciate assistance.
Fred Alyea
(e-mail address removed)

I moved the subForm into the Header Section on a lark and when I open the
form the subForm is displayed. Not sure what this means as im stumbling over
something I have used dozens of times without a problem.
Well when all else fails go back to the basics. I decided to recreate the
Main Form and use the existing subForm and now it works. This is one of
those little things that defies explanation. I recreated the same code I was
using on the Main Form so I have no idea what was causing the problem. What
I have learned is if there doesn't seem to be a logical reason for something
not working I will start over. I just wish I knew what might have caused the
problem that repair and compact didnt correct.

Thanks for you help!
 
M

Marshall Barton

That's a relief. It's nice to know it was an aberration.
Thanks for posting the resolution.

I would like to caution you that Compact/Repair is very
definitely not a panacea. It's more likely that there was
some kind of corruption, which responds better to
SaveToText/LoadFromText, Decompile or maybe even Import.

Side note: code corruption is most often caused by editing
the form/report's code when the form/report is not in design
view.
 
T

Tylendal

Marshall Barton said:
That's a relief. It's nice to know it was an aberration.
Thanks for posting the resolution.

I would like to caution you that Compact/Repair is very
definitely not a panacea. It's more likely that there was
some kind of corruption, which responds better to
SaveToText/LoadFromText, Decompile or maybe even Import.

Side note: code corruption is most often caused by editing
the form/report's code when the form/report is not in design
view.
Thanks for that information Marsh on editing when not in Design view. I was
doing just that with this form and it might have caused my problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top