Default Email client

  • Thread starter Thread starter Saxman
  • Start date Start date
S

Saxman

I have a field in my 'Customer' table based on a template database. It has web link
properties and executes successfully by double-clicking on the link.

I wish to convert it to an email link, so that it opens up the default email client
on the local computer.

I guess I just need to change the <a href> in the web link to a mailto: prefix. How
can I do that?

TIA
--
 
create custom vb code

onclick use this :
DoCmd.SendObject acSendNoObject, , , "to", "cc", , "subject", "body",
True

with no cc,subject or body just normal, opening with address only fill
supposed that the control that the address where is shown is called
label1 on his double click code this

DoCmd.SendObject acSendNoObject, , , label1, , , , , True

this will open a default email program with the the value contained
inside label1
 
Franck said:
create custom vb code

onclick use this :
DoCmd.SendObject acSendNoObject, , , "to", "cc", , "subject", "body",
True

with no cc,subject or body just normal, opening with address only fill
supposed that the control that the address where is shown is called
label1 on his double click code this

DoCmd.SendObject acSendNoObject, , , label1, , , , , True

this will open a default email program with the the value contained
inside label1

Thanks for your quick response.

As I'm a bit of a dummy, would you lead me by the hand and take me stage by stage?
I undersatnd a bit about coding.

As I said before the field is formatted as a hyperlink and works with web addresses.
The control source for the field is 'Email'.

Thanks.


--
 
here the step if you consider the field as a textbox,
right click on it, select the first option should be something like
Create event or Create code event
i can't say exactly my office suite is in french so ill try translate
as much as i can
after select the option saying code generator, NOT the one with macro
in the name
sfter you appear in the vba inferface you control selected
me my text box was named the name of my field fld_ticketitemID

so thats my sub
Private Sub fld_ticketitemID_BeforeUpdate(Cancel As Integer)

End Sub

as you can see the second part say beforeupdate, we want doubleclic
so keep the cursor ready to write between the private sub and the end
sub and check the top right combobox
should be written before update clic on it and select doubleclic that
is called DblClick

so here anotehr sub should have appeared

Private Sub fld_ticketitemID_DblClick(Cancel As Integer)

End Sub

now put the code in it like this

Private Sub fld_ticketitemID_DblClick(Cancel As Integer)
DoCmd.SendObject acSendNoObject, , , fld_ticketitemID, , , , , True
End Sub

and its done, now when you double clic the code is launch and open
default program and add the value of my textbox in that case
fld_ticketitemID to the "To" in the email
 
Franck said:
create custom vb code

onclick use this :
DoCmd.SendObject acSendNoObject, , , "to", "cc", , "subject", "body",
True

with no cc,subject or body just normal, opening with address only fill
supposed that the control that the address where is shown is called
label1 on his double click code this

DoCmd.SendObject acSendNoObject, , , label1, , , , , True

this will open a default email program with the the value contained
inside label1


I had a bash and the following nearly works by assigning a control to my field
Text34 with DblClick. I get a Run-Time error with label1 in the code below, as it
cannot (obviously) find the variable. What should I substitute instead?

DoCmd.SendObject acSendNoObject, , , label1, , , , , True
--
 
I had a bash and the following nearly works by assigning a control to my field
Text34 with DblClick. I get a Run-Time error with label1 in the code below, as it
cannot (obviously) find the variable. What should I substitute instead?

DoCmd.SendObject acSendNoObject, , , label1, , , , , True
--

As i see you really know nothing about vba, it's not bad ill help you
out, but i suggest if you plan work with access for long term to start
reading a bit how to use it at least multiple sample ode can help you
out with those kind of situations, anyway

from what you post your control seems to be call Text34
so substitute label1 per Text34
so your sub should look like this :

Private Sub Text34_DblClick(Cancel As Integer)
DoCmd.SendObject acSendNoObject, , , Text34, , , , , True
End Sub
 
Franck said:
from what you post your control seems to be call Text34
so substitute label1 per Text34
so your sub should look like this :

Private Sub Text34_DblClick(Cancel As Integer)
DoCmd.SendObject acSendNoObject, , , Text34, , , , , True
End Sub

Here is the code below that I have created. Exactly the same as the yours above,
but it still opens up a website.

Private Sub Text34_DblClick(Cancel As Integer)
DoCmd.SendObject acSendNoObject, , , Text34, , , , , True
End Sub

It must be because I need to alter a href to mailto: somewhere. All this is a pain
in the backside. I would have thought Access more user friendly (such as Frontpage)
when dealing with issues like email links.

The help files or user group history doesn't have much help.

--
 
Yeah because your control is a link, the link trigger your browser
first so he dont go to the code, it's normal, right click on your link
in edit mode and there a trasform option in the right click menu you
should be able to trasmform it into textbox and try after you will see
it work
 
Franck said:
Yeah because your control is a link, the link trigger your browser
first so he dont go to the code, it's normal, right click on your link
in edit mode and there a trasform option in the right click menu you
should be able to trasmform it into textbox and try after you will see
it work

I went to my customer table in design mode, changed the properties from 'hyperlink'
to 'text' and all works well.

You are a genius!

I owe you a drink!

John.

Essex, UK

--
 
Franck said:
i knew that : )


hum UK to Canada it's a bit far :P

It's a pity. We have a lot of very small brewers here who brew many kinds of beer.

I'll make a toast to you on Saturday night!

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top