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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I would like to hide a label for a

Status
Not open for further replies.

ALSav

Technical User
Feb 21, 2001
66
0
0
GB
I would like to hide a label for a text box if the text box is empty but I don't seem to be able to get it to work. Here's the code I'm using

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If Leaving_Date = "" Then
Me!Label23.Visible = False
Else
Me!Label23.Visible = True
End If

End Sub

Any help appreciated
 
first you should check if your If statement is testing true.
next you should try your syntax, usually the label for the textbox is something like Me![textboxname label].visible.
and third Leaving_Date if it's a textbox should be Me!Leaving_Date.

HTH

PsychPt@Hotmail.com
 
Don't know if this could be the problem but I noticed that you're also checking for an empty string (""). You could also check for NULL.

Ex.:

If IS NULL (Leaving_Date) then

Hope that helps
Miss Yu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top