Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make textboxes visible or invisible 1

Status
Not open for further replies.

Moss100

Technical User
Aug 10, 2004
584
GB
Hello,

I am just learning how to code.

I have a form - repairs

I have a textbox text800
and
I have a textbox: text100

I would like code to make text100 not be visible when text800 is empty and be visble when text50 has soemthing in it.

I was thinking that the code should be addres to the on current event - is this correct?

I have tried:
If IsNull(Me.Text800) Then
Me.[text100].Visible = False
Else
If Not IsNull(Me.Text800) Then
Me.[text100].Visible = True
End If


Thanks for any help
 
Hi,

You are using a different syntax for text100 & text800...WHY???

Also the negation (the Else state) of IsNull() is ALREADY Not IsNull(). So why the second If, for which BTW, you have no End If!!!

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Thanks for the reply - I wonder whether you could type the code that I should use - i've literally just begun learning code and you answer is probbely great, but a little advanced for me :)

Many thanks Mark
 
Something like
Code:
If IsNull(Me.Text800) Then
   Me.[text100].Visible = False
Else
   Me.[text100].Visible = True
End If

More concisely though
Code:
Me.[text100].Visible = NOT IsNull(Me.Text800)
 
How are ya Moss100 . . .

According to your logic, there are two unknown states:
[ol][li]txt800 IsEmpty and txt50 IsNotEmpty[/li]
[li]txt800 IsNotEmpty and txt50 IsEmpty[/li][/ol]
[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top