Connecting Tech Pros Worldwide Help | Site Map

Place Fields In Particular Spot On Form

Cindy
Guest
 
Posts: n/a
#1: Jun 27 '08
Hi. Based on the machines I select, certain fields of entry are made
to be visible on a form. The problem is that I want them (the fields)
one right under the other but do not want any blank or empty spaces if
a field is not being used. It is easy enough to place one field on
top of the other and make it visible if need be, but there are quite a
few of them, and the same ten fields (for example) would have to be
put one right over the other _at each placeholder_ in the form. That
is quite cumbersome and not very practical. In short, is there any
way to simulate a "can grow"-type scenario with actual fields of
entry?

Thank you kindly,

Cindy
Linq Adams via AccessMonster.com
Guest
 
Posts: n/a
#2: Jun 27 '08

re: Place Fields In Particular Spot On Form


You understand, I hope, that there's not going to be an easy way to do this!

How many different combinations do you anticipate?

If I were trying to do this, I'd use a Tabbed Control, setting up a page for
each machine, with the textboxes needed for that particular machine, arranged
as you like.

After each page was set up, I'd select the Tabbed Control (make sure it's the
control itself, not one of the pages) and set its Style to "None." This will
remove the tabs from the top.

Either set the Visibility property for each page to No/False, or set all of
them to False except the page, if any, that shows all the textboxes,
whichever you prefer for cosmetic purposes.

When the machine is selected, set the Visibility for the appropriate page to
True.

You'll need to place the same code that decides which tabbed page is visible
in the Form's OnCurrent event as well.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via http://www.accessmonster.com

Carlos Nunes-Ueno
Guest
 
Posts: n/a
#3: Jun 27 '08

re: Place Fields In Particular Spot On Form


Another option would be to use subforms. You can stack one subform on top
of another and set the visibility as necessary. I just used this strategy
with a DB that needed to compile information from a bunch of paper forms
that had two different formats, with some fields shared but the majority
specific to one format or the other. I put the shared fields in one table
and subclassed the fields that applied to just one form or another out to
their own tables. Then I was able to use separate subforms for the
distinct layouts and field groupings.

If you use this strategy you have to be careful about how the main form and
subforms interact, because it can get unpredictable and you can create
update problems for yourself if you don't have it quite right. But this
way you can create your form layout once, do a save as to duplicate the
form, and change the control sources on the new form to what they need to
be. That gets you your consistent layout with the different data sources.
bobh
Guest
 
Posts: n/a
#4: Jun 27 '08

re: Place Fields In Particular Spot On Form


On Jun 1, 10:00*pm, Cindy <cindyc...@hotmail.comwrote:
Quote:
Hi. *Based on the machines I select, certain fields of entry are made
to be visible on a form. *The problem is that I want them (the fields)
one right under the other but do not want any blank or empty spaces if
a field is not being used. *It is easy enough to place one field on
top of the other and make it visible if need be, but there are quite a
few of them, and the same ten fields (for example) would have to be
put one right over the other _at each placeholder_ in the form. *That
is quite cumbersome and not very practical. *In short, is there any
way to simulate a "can grow"-type scenario with actual fields of
entry?
>
Thank you kindly,
>
Cindy
Hi,
You can use the Left and Top properties to specify an object's
location on a
form, but if you have a 'lot' of controls then this will be very vba
code writing tedious.
bobh.
Tony Toews [MVP]
Guest
 
Posts: n/a
#5: Jun 27 '08

re: Place Fields In Particular Spot On Form


Cindy <cindyc100@hotmail.comwrote:
Quote:
>Hi. Based on the machines I select, certain fields of entry are made
>to be visible on a form. The problem is that I want them (the fields)
>one right under the other but do not want any blank or empty spaces if
>a field is not being used. It is easy enough to place one field on
>top of the other and make it visible if need be, but there are quite a
>few of them, and the same ten fields (for example) would have to be
>put one right over the other _at each placeholder_ in the form. That
>is quite cumbersome and not very practical. In short, is there any
>way to simulate a "can grow"-type scenario with actual fields of
>entry?
What type of machines and what type of fields? I ask because maybe the database
isn't properly normalized and maybe some of those fields should be in their own
tables. Maybe.

What I prefer to do though would be to change the fields Enabled property to No.
This greys out the field and the user can't enter anything.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
Closed Thread