Controls on top of each other

K

Kat

Hi All,

I am trying to create a "search" form that will allow the users to select a
few different options (option groups) and then get the approriate data from
the database.

The problem I am having is really from a designer point of view than from
the user. The user can select something from option group 1 and that will
make option group 2 visable. If they select something else from option group
1 it will make option group 3 visable. The problem I am having is I want
option group 2 and 3 to visually exist in the same "space". This is easily
done for the user by hiding the controls they dont need to see, but it is
difficult for me visually when actually developing the form. This is further
complicated by the fact that while I am doing the development on this form
now, someone else will be taking over in a few weeks (and I may not even get
to speak to them) and could be very confused by the "mishmash" on the design
screen that this causes.

What I would like to know, is does anyone have any suggestions for
seperating or making things easier to see in design view when the visable
controls to the user still occupy the same visual space?

Thanks in advance for any help anyone can give.

Kat
 
A

Al Campagna

Kat,
The only thing I can think of is to position Opt2 somewhere on the form
design... where you can see it and work on it.
When Opt1 "calls" Opt2, adjust the Opt2 Left and/or Top properties to
position Opt2 where you want it, and then make it visible.
The same with Opt3...
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
K

Kat

See I knew I just needed someone with a different perspective. That is more
or less what I have been doing only I've been moving the control(s) manually
in design view before I load the form up for testing. I never even thought
of moving them at the time they need to be visable to the user. This will
also let me comment the code to explain what its doing to my as yet not
existant successor!

Thanks a lot.

Kat
 
M

Mr B

Kat,

Al's method is an absolutely acceptable method for dealing with controls
that need to be managed to appear in specific locations.

However, I thought that I would just share another optional method that will
also work and might be effective in your situation.

If you create a tab control and place your option groups on individual pages
of the tab control then you can show the use the appropriate page of the tab
control based on their selections for your other controls.

A tab control can be set up so that the user never sees the tabs but you can
have them available during develpment.

To try this method, first create your tab control and place your options
groups on individual tab pages. Run your form and you will see a normal tabl
control.

Next, add the following code to the Open event of your form:

'show no tabs on the tab control
'and set focus to a specific page
With Me.NameOfYourTabControl
.Style = 2 'hide the tabs
.BackStyle = 0 'make control transparent
.Pages(1).SetFocus 'set focus to page
End With

You can position your option controls on the tab control to always be in the
appropriate location and yet switch the use to a different option group by
simply setting the focus to the appropariate page of the tab control with
this statement:

'set focus to the second page of the tab control
Me.NameOfYourTabControl.Pages(1).SetFocus

This is just one more way to accomplish what you need to do. This becomes
more of an interesting option when you have more than just a couple of
controls that need to be switched out based on a user's selections.
 

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