Making test box visible

S

Sevi

Hi,

I'm using a form to enter data in a table, where in there is combo box. If
i select a purticular value (WIP) in the combo then a related text box has to
be visible. In all other cases the text box has to be invisible. how to do
it, can anyone please help.

Smiles, Sevi
 
J

Jeanette Cunningham

Hi Sevi,

something like-->

If Len(Me.NameOfCombo) >0 Then
If Me.NameOfCombo = "WIP" Then
Me.NameOfTextbox.Visible = True
Else
Me.NameOfTextbox.Visible = False
End If
End If

The above code goes in the After update event for the combo
Replace NameOfCombo and NameOfTextbox with the real names.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
J

John W. Vinson

Hi Sevi,

something like-->

If Len(Me.NameOfCombo) >0 Then
If Me.NameOfCombo = "WIP" Then
Me.NameOfTextbox.Visible = True
Else
Me.NameOfTextbox.Visible = False
End If
End If

The above code goes in the After update event for the combo
Replace NameOfCombo and NameOfTextbox with the real names.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

You may also want to put the same code in the form's Current event to make the
textbox (in)visible when you navigate to a different record.
 
S

Sevi

Hi John,

Wonderful solutions...it's working well

Yet I have one problem. While data entry, text is geting visible/invisible
according to value selected in the combo, but while scrolling through the
records in the form, even for those records where combo value "WIP" the text
box is not geting visible.

pls help me.

Smiles, Sevi
 
J

John W. Vinson

Hi John,

Wonderful solutions...it's working well

Yet I have one problem. While data entry, text is geting visible/invisible
according to value selected in the combo, but while scrolling through the
records in the form, even for those records where combo value "WIP" the text
box is not geting visible.

If it's a Single view form you need to put Jeanette's code in the Current
event *as well as* the combo's afterupdate.

If it's a Continuous Form you'll need to use Conditional Formatting instead.
 

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