Conditional visibility of button on continuous subform

AChir

Registered User.
Local time
Today, 22:51
Joined
Oct 4, 2001
Messages
51
I have a form which contains a continuous subform. Next to every record in the subform is a button which opens an email to the contact in the current record. We don't have e-mail addresses for some contacts so I'd like the button to be invisible for those records. Using...

Code:
Private Sub Form_Current()
If Me.EMailAddress > "" Then
Me.EMailThisOne.Visible = True
Else
Me.EMailThisOne.Visible = False
End If
End Sub

... either every button is visible or every button is invisible, depending on whether the current record contains an email address. Similar questions about text boxes on continuous subforms elsewhere in the forum have left me still stuck. Any ideas, please, or is this just not possible? It sounds such a simple thing to do.... given it can be done on a report so easily it would seem crazy if it can't be done on a form

Thanks very much for reading this far. Please help if you can
 
Take a look at Format/Conditional Formatting (on the ribbon in 2007). If memory serves, you can't format a button, but you could create a textbox that looks like a button and format that.
 
Thanks - that has worked... I'll have a tinker to see if I can make it look a bit more button-like when it is clicked. It's a pity to lose the letter image but that's purely cosmetic and your idea has done the trick.

Thanks for your help - and fast help at that !

:)
 

Users who are viewing this thread

Back
Top Bottom