Field display question...

  • Thread starter Thread starter Charlie
  • Start date Start date
C

Charlie

Hi all,
is it possible to have a form that will only display the fields of
each record if the field is populated. I'd like any field in each
record that has no info to not display on the form. Can this be done
?? Many thanks for your help. Charlie.
 
Charlie

While possible, do you really want to have controls on your form winking in
and out of existence? This can be confusing and irritating to users.

Take a look at the .Visible property of each control if you decide you must
follow through. When the current record loads (the OnCurrent event), you'll
have to have some code to run through each of the controls, checking for
non-null values, and setting/resetting the .Visible property.
 
This is not possible in a continuous form or datasheet.

In Form view, it is possible to use the Current event of the form to
progammatically loop through your controls and set the Visible property to
No if the control is null.

It may be a better idea to come up with a relational design, so you do not
have as many null fields.
 
I don't want to go too far in wondering if you meant
something other than what you said, but are you asking
about something that will be printed? If so, you will be
working with a report rather than a form. In that case,
it is very possible to hide blank fields. It could be as
simple as setting the Can Shrink property of the controls
to Yes. Labels will complicate the task a bit, but it
should be possible to take care of it with some code in
the Report's On Open event. Post again if you need
details.
 
Hi Jeff,

thanks for your response. This database won't be seen by any users, only
me...so I'm not worried on that front. I've made a database table of all
the hardware in the building. Some of the kit won't have any info for some
of the fields that other hardware has, if you see what I mean, so that's why
I was thinking of having the fields with no data invisible...just to make
the form look a bit more tidy.

cheers,
Charlie.
 
Back
Top