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!

Storing an Email so it can be "clicked on" and opened

Status
Not open for further replies.

timnicholls

Technical User
Oct 31, 2003
43
AU
Hi All,

I wish to store a clients email address in a field.

So when you go through each record, the email appears in
the textbox and you can click on it to open an email
to that person.

I do not think textboxes have a hyperlink address property.

Any ideas anybody??

Tim
 
Textboxes "inherits" the field properties of the field theire bound to. I'm not able to check versions prior to access 97, but a table field might be set to datatype "hyperlink".

Check out if this solves your challenge.

Don't use them myself, but I think you must enter the e-mail address with mailto: name@domain.com, but check it out.

Roy-Vidar
 
Roy-Vidar,

The table properties do allow a selection of a hyperlink,
like you select "text" or "number". But that is only a web hyperlink as I understand it "
Is the problem the textbox on the form though...

How do you make it so the arrow changes to a hand as it goes over it, if you follow.

Tim
 
Did you try?

1 - create/change a table field to datatype hyperlink
2 - goto the forms design view, find the field list
3 - drag the field (with hyperlink) onto the form

The "inheritance" isn't automatic.

I did state also that I think you must enter the e-mail address with mailto: name@domain.com, but check it out.

To be a bit more specific, when entering an email address, start with mailto: before entering the actual address.

Roy-Vidar
 
Tim,
I just tried this on a small Db just created, and had no problems (Access '97).
The datatype properties of the field in the table needs to set at hyperlink.
Which version of Access are you using?
When the cursor moves over the field in the form, it will change to a hand. Like Roy said, make sure the entry in the field starts with mail to: to access the email address, rather than having Access search for a web page.

Cheers,

Kev.


Never trust the French.
How can you trust a country that has 256 different types of cheese.
- Spike Milligan.
 
Thanks

Roy-Vidar and Kev,

Unfortunately my email field is an unbound textbox getting input from a combobox via a Control Source which is:

"=cboManager.Column(6)" where Column 6 is the email address of the Manager. So the email address appears in the textbox but it is not "hyperlink ready" so to speak.

I have even selected the property of the textbox to say:
Is Hyperlink - yes. But to no avail.

Is there any other way I can get an unbound textbox to be a hyperlink??

BTW thanks again...both of you.

Tim
 
That means the email field is alredy stored, one possibility is to construct the query/recordsource of the form so that you could bind the control to this field in the forms recordsource.

One other way, is to revert back to using a textfield (without hyperlink/mailto:). Then use a button to run for instance something like this:

[tt]docmd.sendobject acsendnoobject,,,Me!txtEMail,,,"Subject",,True[/tt]

- don't use this much, but more on the syntax and arguments in the help or searching here on TT with keyword e-mail.

Roy-Vidar
 
Roy-Vidar,

Your docmd.sendobject works well.

Thanks!!!

I am now trying to make the cursor change to a hand when it goes over the textbox.

Shall I do a search in TT for cursor and hand?

Tim
 
Not sure you'll find anything on that. Think experiment with some of the controls mouse events (mouseover?). Have no knowledge of that whatsoever, but think there's been some threads on changing colors on text controls using such not long ago in one or more of the access fora. They might provide something (if the user isn't satisfied with hitting a button;-))

Search with mouse over, mouseover, change text... might provide something (or someone else might pop into this thread)

Roy-Vidar
 
Ok,
Create a new module called Handover.
Insert this code:


'*********** Code Start ************
' This code was originally written by Terry Kreft.
' It is not to be altered or distributed,
' except as part of an application.
' You are free to use it in any application,
' provided the copyright notice is left unchanged.
'
' Code Courtesy of
' Terry Kreft
'
Public Const IDC_APPSTARTING = 32650&
Public Const IDC_HAND = 32649&
Public Const IDC_ARROW = 32512&
Public Const IDC_CROSS = 32515&
Public Const IDC_IBEAM = 32513&
Public Const IDC_ICON = 32641&
Public Const IDC_NO = 32648&
Public Const IDC_SIZE = 32640&
Public Const IDC_SIZEALL = 32646&
Public Const IDC_SIZENESW = 32643&
Public Const IDC_SIZENS = 32645&
Public Const IDC_SIZENWSE = 32642&
Public Const IDC_SIZEWE = 32644&
Public Const IDC_UPARROW = 32516&
Public Const IDC_WAIT = 32514&

Declare Function LoadCursorBynum Lib "user32" Alias "LoadCursorA" _
(ByVal hInstance As Long, ByVal lpCursorName As Long) As Long

Declare Function LoadCursorFromFile Lib "user32" Alias _
"LoadCursorFromFileA" (ByVal lpFileName As String) As Long

Declare Function SetCursor Lib "user32" _
(ByVal hCursor As Long) As Long

Function MouseCursor(CursorType As Long)
Dim lngRet As Long
lngRet = LoadCursorBynum(0&, CursorType)
lngRet = SetCursor(lngRet)
End Function

Function PointM(strPathToCursor As String)
Dim lngRet As Long
lngRet = LoadCursorFromFile(strPathToCursor)
lngRet = SetCursor(lngRet)
End Function
'*********** Code End ************


Then on the Mouse Move event of your field, enter this code:

MouseCursor (32649)

Hope this helps.

Kev.




Never trust the French.
How can you trust a country that has 256 different types of cheese.
- Spike Milligan.
 
Thanks,

That code did really do the trick.

Problem solved...thanks kev and Roy-Vidar

Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top