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

Hide Text Box IF..... 2

Status
Not open for further replies.

dddivers

Instructor
Dec 4, 2001
30
US
Can someone help? I have an Access form that is fed from a table. I want a text box control on the form (say for the phone number field) to hide IF there is no data for that field for that particular record stored in the underlying table; however, if there is data for that field in the underlying table, I want the text box to magically appear on the Form for that record and show the data.

I think this may have something to do with the Form's On Current property (GoToControl command), but I'm not sure how to write the macro or VB to make this happen.

Thank you - dddivers
 
Assuming both your textbox and the field are named Phone ...

Private Sub Form_Current()

Me!Phone.Visible = Not IsNull([Phone])

End Sub
 
How are ya dddivers . . . .

JoJ's solution is right on for a Single Form, but for a Continuous Form your stuck with Conditional Formatting.

TheAceMan [wiggle]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top