Hi guys
probably pretty straight forward but cant seem to get it going...
i have a command button to click to send an email to the email address in a field. it works great unless the user has not entered anything into the textbox. and im getting an error if the text box has normal text in it (i dont want to make the field set to hyperlinks or emails only as some users will use this for a second telephone number).
Once the user clicks the command button how can i get access to check if the text box has a valid email address then proceed if so, otherwise ignore the click with no error??
TIA
probably pretty straight forward but cant seem to get it going...
i have a command button to click to send an email to the email address in a field. it works great unless the user has not entered anything into the textbox. and im getting an error if the text box has normal text in it (i dont want to make the field set to hyperlinks or emails only as some users will use this for a second telephone number).
Once the user clicks the command button how can i get access to check if the text box has a valid email address then proceed if so, otherwise ignore the click with no error??
Private Sub Command67_Click()
Dim strPath As String
strPath = Me.PurchaserContact2
If InStr(1, strPath, "@", vbTextCompare) > 0 Then
strPath = "MailTo:" & strPath
End If
Application.FollowHyperlink strPath
End Sub
TIA