Code for making a text box visible and invisible

  • Thread starter Thread starter rama
  • Start date Start date
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.
 
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
 
 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
 
Back
Top