Visible control based on other inputs

T

Ticotion

Hi

I have a form where the user choose shift, Sektor, Cell, Date from 4
different comboboxes.

The cell combobox is based on a query that gives you the cells that
corisponds to a sektor when the sektor is choosed.

The query looks like this

SELECT TblCelle.CelleNr, TblCelle.CelleTxt, TblCelle.Sektor
FROM TblCelle
WHERE (((TblCelle.Sektor)=[Forms]![FrmReg]![Sektor]))
ORDER BY TblCelle.CelleNr;

TblCelle has the following fields

CellNo, CellTxt, CellVar, CellCat, Sektor

The CellVar can have two input either L or H

I have a text box and a label that should not be visible if the CellVar = L.
If the CellVar = H, it should be visible and ready for input

How can this be done?

Br.
Ticotion
 
T

Tom van Stiphout

On Tue, 17 Nov 2009 01:54:01 -0800, Ticotion

Add CellVar to the dropdown, say as the last (4th) column.
Then in the dropdown's AfterUpdate write:
Me.myTextbox.Visible = Me.myCombobox.Column(3)
(of course you replace myObjectNames with yours)

-Tom.
Microsoft Access MVP
 
M

Marshall Barton

Ticotion said:
I have a form where the user choose shift, Sektor, Cell, Date from 4
different comboboxes.

The cell combobox is based on a query that gives you the cells that
corisponds to a sektor when the sektor is choosed.

The query looks like this

SELECT TblCelle.CelleNr, TblCelle.CelleTxt, TblCelle.Sektor
FROM TblCelle
WHERE (((TblCelle.Sektor)=[Forms]![FrmReg]![Sektor]))
ORDER BY TblCelle.CelleNr;

TblCelle has the following fields

CellNo, CellTxt, CellVar, CellCat, Sektor

The CellVar can have two input either L or H

I have a text box and a label that should not be visible if the CellVar = L.
If the CellVar = H, it should be visible and ready for input


Try using the CellVar control's AfterUpdate event:

Me.[the text box].Visible = (Me.CellVar = "H")
 

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