A2007: container

  • Thread starter Thread starter =?windows-1250?Q?Vladim=EDr_Cvajniga?=
  • Start date Start date
?

=?windows-1250?Q?Vladim=EDr_Cvajniga?=

Does A2007 have some kind of contariner control as we know it from VB?
 
If you are asking about the interface, there is a navigation pane.

If you mean programmatically, the DAO library provides a Containers
collection that exposes Documents of type Form and Report. The DAO object
model tree is illustrated here:
http://allenbrowne.com/ser-04.html

You can also locate the objects in the database using a query:
SELECT MSysObjects.Type, MSysObjects.Name
FROM MSysObjects
WHERE Not MSysObjects.Name Like "~*"
ORDER BY MSysObjects.Type, MSysObjects.Name;

In Access 2000 and later, you can also use:
CurrentProject.AllForms
CurrentProject.AllReports
 
Thx for your respond, Allen.

In VB forms there are Frame and Picture that can act as a container, ie. you
can put "subcontrols" in Frame or Picture. When you move a container all
"subcontrols" are moved with it and Visible property of the container
applies to all "subcontrol" as well.
In Access we have OptionGroup and TabControl but they both have some issues.
Worse af all: nor Move event neither .Left, .Top don't move controls which
"are contained" within TabControl or OptionGroup. One must write a few lines
of code to handle all "subcontrols" after Move event or after changing
..Left/.Top property of the "container".

Vlado
 
Okay, perhaps someone else has some suggestions.

Access does lack control arrays. There are ways to group controls, but not
for the purpose you are talking about.

Access 2007 has stacked controls (on the Arrange tab of the ribbon in form
design.) You can try resizing/relocating these at runtime, but the results
are not ideal. A quick test on a vertical stack finds:
- setting Left does nothing (i.e. they don't move.)
- setting the Width of one affects all (fair enough.)
- setting the Height works (and the others move up/down according to space.)
- setting the Top moves the control's position within the stack, provided
you move it enough to allow another one in.

Part of the issue is that, unlike VB, the controls you see on screen do not
exist. They are nothing more than graphical bits until they get focus. When
a control receives focus, it becomes a window and gets an hWnd, so there is
really only one control on screen at a time. That's a bit of an
oversimplification, but the whole model of handling them is racically
different than in pure VB.
 
Thank you for explanation, Allen... and for the tests too.

Then I'll have to create a function that handles controls within TabControl
which is the best in Access "container" controls so far. In fact I already
have that function (I've done it yesterday), but it needs some testing
before it's ready for my colleagues.

Vlado
 

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

Back
Top