To make a box visible if field isnt blank

  • Thread starter evilcowstare via AccessMonster.com
  • Start date
E

evilcowstare via AccessMonster.com

Is there away in which I can make a box visible the moment a text box has had
info entered into it?

Basically I have a red box that I am using behind a button which I want to
appear once someone has entered info into a particular field to flag up that
there is info there, does anyone know the best way?

Thank You
 
B

Bill

I assume that you're talking about a "Formscoding"
question rather than a "Report", which is the major
topic of this NG. That being the case, you can use
the OnChange event to examine the content of the
text box and toggle it's visibility property accordingly.

Private Sub MyTextBox_Change()
If Len(Trim(Me.MyTextBox) & "") > 0 Then
MyTextBox.Visible = True
Else
MyTextBox.Visible = False
End If
End Sub

Bill
 
E

evilcowstare via AccessMonster.com

Hi Bill,

apologies for this being in the wrong place, my mistake, I was looking at
another post in reports then remembered I needed to find this out.

Thank you for the code, I will give it a try

:)
I assume that you're talking about a "Formscoding"
question rather than a "Report", which is the major
topic of this NG. That being the case, you can use
the OnChange event to examine the content of the
text box and toggle it's visibility property accordingly.

Private Sub MyTextBox_Change()
If Len(Trim(Me.MyTextBox) & "") > 0 Then
MyTextBox.Visible = True
Else
MyTextBox.Visible = False
End If
End Sub

Bill
Is there away in which I can make a box visible the moment a text box has
had
[quoted text clipped - 6 lines]
Thank You
 

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