Acess VBA frames for layout control

Posted on 2006-05-17
Medium Priority
Last Modified: 2008-02-01
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,
Question by:OuttaCyTE
  • 2
  • 2
  • 2
LVL 77

Expert Comment

ID: 16701571
Hi OuttaCyTE,

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

LVL 58

Accepted Solution

harfang earned 500 total points
ID: 16714804
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!
LVL 77

Expert Comment

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 16722303

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.
LVL 58

Expert Comment

ID: 16724098

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!

Author Comment

ID: 16725310
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,

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question