Turn several forms into one with Tab Control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Currently I have several forms that are accessed via a switchboard, but it
would be much easier to put them all on one big form and switch between them
with a Tab Control.
Problem is, when these forms essentially become sub-forms of the form that
has the tab control, all of the macro references get messed up and the forms
don't work.

Anyone know of a better way to do this?

Thanks
 
Yes, all the macros will have to be redone if you turn your forms into
subforms on the pages of a tab control.

The better solution is probably to use code instead of macros. You can then
use "Me" instead of "Forms.Form1", and the code continues to work if the
form is a subform or renamed or whatever. It might be worth learning about
code if you are serious about making this change. (Access can convert macros
to code, but the result is not very good.)

Before you go too far, though, you don't want to create one monster form
that has dozens of subforms and tries to do everything. That becomes a very
cluttered interface, and unweildy to use. The best solution is probably a
few different forms, with a no more than half a dozen tab pages on each.
 
I started to turn some of my macros into code, but it looks like one of the
problems still exists with code also.

I can't seem to run the ApplyFilter command, in a macro or code, because the
main form that contains the tabs is unbound, and Access tells me that I can't
use Applyfilter when a form is unbound. Actually the form that contains the
code IS bound but that doesn't seem to matter.

I need to go with the subform method as opposed to putting tabs on main main
form because I have a header/footer section with detail section style
'continuous'. That tabs can only exist in the detail section.
 
Rather than using the ApplyFilter action, try setting the Filter property of
the form.

The Filter property should look exactly like the WHERE clause of a query,
and you also need to set FilterOn as well.

Example:
Me.Filter = "[City] = 'Springfield'"
Me.FilterOn = True
 
Back
Top