Displaying and hiding controls on datasheet form?

  • Thread starter Thread starter Niklas Östergren
  • Start date Start date
N

Niklas Östergren

Hi!

Is there anyway to show/hide controls on a datasheet form?

I know that I can use a continiuse form to do that and if there isn´t any
solution to this in datasheet form I don´t have any choise. But if possible
I´d realy would like to be able to do this in a datasheet form.

The form where I´d like to display/hide the controls in is a subform which
I´d like to change the recordsource on depending on what the user selects.
Either I´d like to show all members i the assosiation or I´d like to show
all registrated persons. And one of these recoprdsource don´t have some
fields which is in the other recordsource. For instance not all registrated
persons have a [MemberNo].

TIA!
// Niklas
 
The main reason to why I´d like to use a datasheet form instead of a
continous is that it´s so easy for the user to change the column width. And
sometimes the data differs a lot in lengt (street names for instance).

TIA!
// Niklas
 
IIREC correctly, you can. Simply set the Visible Property of the Control
corresponding to the Column you want to hide to False.

Another way is to use 2 _different_ Forms and use code to change the
SourceObject for the SubformControl to the required Form from the 2.

Check Access / Access VB Help on the SourceObject Property.

--
HTH
Van T. Dinh
MVP (Access)



Niklas Östergren said:
The main reason to why I´d like to use a datasheet form instead of a
continous is that it´s so easy for the user to change the column width. And
sometimes the data differs a lot in lengt (street names for instance).

TIA!
// Niklas

Niklas Östergren said:
Hi!

Is there anyway to show/hide controls on a datasheet form?

I know that I can use a continiuse form to do that and if there isn´t any
solution to this in datasheet form I don´t have any choise. But if
possible I´d realy would like to be able to do this in a datasheet form.

The form where I´d like to display/hide the controls in is a subform which
I´d like to change the recordsource on depending on what the user selects.
Either I´d like to show all members i the assosiation or I´d like to show
all registrated persons. And one of these recoprdsource don´t have some
fields which is in the other recordsource. For instance not all
registrated persons have a [MemberNo].

TIA!
// Niklas
 
Well, may there be some other properti for the controls that may be set to
some specific value to make this work? Because I have allready tryed that
(to change Visible property = False) and the column´s is thiss visible.

To use two different form´s is one solution that I have thought of, but
didn´t mentioned eralier. The thing is that for maintenance purpose I´d like
(if possible) to keep with ONE form since there are only 3 controls that
shouldn´t be visible in one occation and there are not a lot but some code
on the subform´s code module.

Thanks´for helping out!

// Niklas

Van T. Dinh said:
IIREC correctly, you can. Simply set the Visible Property of the Control
corresponding to the Column you want to hide to False.

Another way is to use 2 _different_ Forms and use code to change the
SourceObject for the SubformControl to the required Form from the 2.

Check Access / Access VB Help on the SourceObject Property.

--
HTH
Van T. Dinh
MVP (Access)



Niklas Östergren said:
The main reason to why I´d like to use a datasheet form instead of a
continous is that it´s so easy for the user to change the column width. And
sometimes the data differs a lot in lengt (street names for instance).

TIA!
// Niklas

Niklas Östergren said:
Hi!

Is there anyway to show/hide controls on a datasheet form?

I know that I can use a continiuse form to do that and if there isn´t any
solution to this in datasheet form I don´t have any choise. But if
possible I´d realy would like to be able to do this in a datasheet
form.

The form where I´d like to display/hide the controls in is a subform which
I´d like to change the recordsource on depending on what the user selects.
Either I´d like to show all members i the assosiation or I´d like to show
all registrated persons. And one of these recoprdsource don´t have some
fields which is in the other recordsource. For instance not all
registrated persons have a [MemberNo].

TIA!
// Niklas
 
I have decided to use two different forms of datasheet type since that´s
what´s best for the user. So I use SorceObject property to select which form
to load in the subform control.

Thank´s for all help!

// Niklas


Niklas Östergren said:
Well, may there be some other properti for the controls that may be set to
some specific value to make this work? Because I have allready tryed that
(to change Visible property = False) and the column´s is thiss visible.

To use two different form´s is one solution that I have thought of, but
didn´t mentioned eralier. The thing is that for maintenance purpose I´d
like (if possible) to keep with ONE form since there are only 3 controls
that shouldn´t be visible in one occation and there are not a lot but some
code on the subform´s code module.

Thanks´for helping out!

// Niklas

Van T. Dinh said:
IIREC correctly, you can. Simply set the Visible Property of the Control
corresponding to the Column you want to hide to False.

Another way is to use 2 _different_ Forms and use code to change the
SourceObject for the SubformControl to the required Form from the 2.

Check Access / Access VB Help on the SourceObject Property.

--
HTH
Van T. Dinh
MVP (Access)



Niklas Östergren said:
The main reason to why I´d like to use a datasheet form instead of a
continous is that it´s so easy for the user to change the column width. And
sometimes the data differs a lot in lengt (street names for instance).

TIA!
// Niklas

"Niklas Östergren" <[email protected]> skrev i meddelandet
Hi!

Is there anyway to show/hide controls on a datasheet form?

I know that I can use a continiuse form to do that and if there isn´t any
solution to this in datasheet form I don´t have any choise. But if
possible I´d realy would like to be able to do this in a datasheet
form.

The form where I´d like to display/hide the controls in is a subform which
I´d like to change the recordsource on depending on what the user selects.
Either I´d like to show all members i the assosiation or I´d like to show
all registrated persons. And one of these recoprdsource don´t have
some
fields which is in the other recordsource. For instance not all
registrated persons have a [MemberNo].

TIA!
// Niklas
 
Back
Top