Code for making a text box visible and invisible

R

rama

Hello
In my data entry form there are some fields cboTag, txtZero etc.
cboTag is having a value list which is LS1201;LT1300 etc. What I wish
to do is if cboTag selection is LS1201 txtZero shoud be invisible to
desable any data entry. Where as cboTag selection is LT1300 then
txtZero should be visible to enable data entry. Kindly help me to
resolve this. Thanks in advance

The code I tried is as follows which gives an error invalid qualifier.

Private Sub cboTag_Click()
Dim txtZero As String
If cboTag = "LS1201" Then
txtZero.Visible = True
Else: txtZero.Visible = False

Rama.
 
R

Roger Converse

Private Sub cboTag_Click()

If me.cboTag.value = "LS1201" Then
me.txtZero.Visible = True
Else:me. txtZero.Visible = False

End sub

I would not suggest creating a variable that is the same as a control on a
form (txtZero).

HTH
Thanks,
Roger
 
R

rama

 Private Sub cboTag_Click()

 If me.cboTag.value  = "LS1201" Then
                me.txtZero.Visible = True
               Else:me. txtZero.Visible = False

End sub

I would not suggest creating a variable that is the same as a control on a
form (txtZero).

HTH
Thanks,
Roger








- Show quoted text -
Thankyou very much for the earliest reply. The code is working fine.
Would you kindly suggest the better way of coding to achieve this
which you hinted.
Rama
 

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