1 sub-form appears in both Tab Controls

D

Dennis

All,

I'm using Access via XP Office Pro w SP3 on XP Pro w SP3.

I have a main form with a tab control that has two pages. Each page has a
different sub-form. The first sub-form is a continuous view form and the
second sub-form is a column data entry form.

When I put the sub-form control on the second tab, it displays and appears
to work. When I put the sub-form control on the first tab, it displays on
both the first and second tab! However, when I load / run the form, even
though the first sub-form appears on both tab pages, the VBA code for the
second form is run.

Any ideas on what is happening and how to fix it?

Also, I put a break point in the second form's On Load and On Current
events. The second sub-forms On Current event breaks, but the On Load event
does not break. I'm guessing this is because the On Load event does not run
for a sub-form? Or is something else going on? If the On Load event does
not run for a sub-form, where do I put my VBA code that I would normally put
in the On Load event.

Thanks in advance for your assitance. Please note I'm cross posting this
to the Module coding group (or at least I will try to).
 
N

NevilleT

Had this problem before. The sub form is probably not on the tab. Cut the
sub form and select the tab. When it is highlighted, paste the sub form.
Hope that works.
 
D

Dennis

Neville,

Thank you for your assitance. I though I had done what you suggested, but
apparently I did not do it correctly.

This time, I deleted the sub-form, increased the size of my tab to ensure
the sub-form fit within it, inserted the sub-form, and then resized my tab to
the correct size and everything is working fine now.


Thanks again.
 
N

NevilleT

Glad to help. Seem to ask more questions than give answers so it is good to
help someone out.
 

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