Acess VBA frames for layout control

Hello Experts,

I need to find the name of the "frame" control/container that can hold drawing elements used in my form layout.

I've tried a couple of things that hold objects, but none of them seem to hold simple drawing objects like rectangles and lines.

What I'm trying to accomplish is making a task pane on the right hand side of the form that stays on the right regardless of the resizing the user might do.  It would be much simpler to set my drawing elements and controls relative to a point on a container (say top left) and then position the container relative to the inside dimensions of the form.

If I have to, I can manually adjust each of the controls, but I shouldn't have to do such a thing.

The frame control/container
o must be able to contain simple drawing objects like rectangles as well as all of the controls one would put on a form.
o must be able to turn on and off (visible/invisible)
o must be resizeable (height & width) & repositionable (top & left)
o contained controls positioning (top & left) must be relative to the top & left of the containing control/collection.
o it would be really cool if the container could optionally have scrollbars to scroll the interior.
o useable with Using Access 2003 VBA

Anyway, that's what I'm looking for.

Another thought is using subforms (ugh!)

So, what control/container am I looking for?  Where do I find it?

Thanks y'all,
Who is Participating?
harfangConnect With a Mentor Commented:
Hello OuttaCyTE

There are two "containers" to choose from in your case.

a) Tab Control (patially meets your requisites)

A tab control with a single page, without tabs or buttons will have a "raised" border. You can however choose a "transparent" backstyle, in which case you can create your own border using  a rectangle.

However, the positioning of objects is not relative to the container, nor does it provide scroll bars.

b) Subform

That totally fits your bill. If needed, the subform displayed in the subform control can share the same recordset, so that you can edit a single record accross the main form and the subform. However, remember that the record gets saved when entering or leaving the subform.

Good luck!
Hi OuttaCyTE,

Not in this universe, I don't think.
Of course, it'll all be like that in Vista(:-)

Mmmm - I guess that's true- I read rather more into 'resizable' and 'repositionable' than the poster might have intended.

Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

OuttaCyTEAuthor Commented:

Tab control I didn't think of, but since the interior placement isn't relative to the container I'm no better off than an arbitrary reference point.

I was afraid subform would be the way to go.  Not very elegant but there it is.

Thanks a lot.

Pete, thanks for responding.  The resizeable and repositionable would be under program control as a part of the form.

In fact, the only two "containers" – option groups and tab controls – are a problem when resizing a form, because you cannot "grab" all enclosed controls as you would in design view. So that moving and enclosed control can resize the container, and attempting to resize the container can silently fail. It's really hard to manage.

Your aim, "making a task pane on the right hand side of the form", it best done with a subform, and I also think it's elegant. For example, the tab cycle is independant (like on a form footer), there is an independant control focus (setting the focus back to the main form reactivates the last control), the main form's current event doesn't create conflicts (you can have auto-repeat  buttons), there is an independant class module (easier to document and maintain), and you have independant form events, although you can still trap any of the main form's events using "withevents" variable... In some cases, the subform is reusable on different forms, as well.

It took me a while, but I now use non-data subforms quite a lot: custom embedded "toolbar", custom navigation buttons, fake calendar control and other missing controls, side menus, logos, etc.

It seems I reacted strongly to "not very elegant"... ;)
Good luck with your project!
OuttaCyTEAuthor Commented:
Snowy Owl, you see clearly!

I can see where the re-usability can be very attractive.  Since your prior response I've been thinking about the ability to re-use the subform in other forms.  Something I handn't considered before.

You make a strong case for subforms.

Anyway, thanks for your responses,
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.