Inserting variables into Hyperlink Address

Lateral

Registered User.
Local time
Today, 10:37
Joined
Aug 28, 2013
Messages
388
Hi guys

I'm a newbie:) I'm using Access 2007.

I have a customer table attached to a form.

I want to put a command button next to the customer's email address so that the user simply presses the button and Outlook will be started with the customer's email address automatically inserted from the table.

I am playing around with the Hyperlink Address function and whilst this seems to do what I want, I can't figure out how to get the customer's email address from the tabel and insert it......

Any help will be greatly appreciated.

Thanks
Regards
Greg
 
I would use SendObject with a reference to the form in the To argument.
 
Thanks for the reply.

I have used send object successfully but it only appears to send in text format without the email signature whereas the hyperlink method appears to use HTML format and does insert the signature.
 
Well, if you show that code we can figure out how to add the address.
 
Hi Paul

I'm not sure what you are asking for.

I'm just creating a Command button and changing the Property setting "HyperLink Address".

Where can I find the "code" that you are refering to?

Regards
Greg
 
There's either VBA code or a macro behind the button.
 
Hi Paul

I have attached 2 screen shots of what I am seeing when I click on the three dots. "...". I am not seeing any VBA code. Also, there is no Event Procedure setting in the On Click property.

Regards
Greg
 

Attachments

  • Hyperlink01.JPG
    Hyperlink01.JPG
    37.4 KB · Views: 99
  • Hyperlink02.jpg
    Hyperlink02.jpg
    103.6 KB · Views: 121
Sorry, I haven't used that method. In a brief test, I could get it to work with a hard-coded address but not by referring to the form. In VBA code, this would work:

DoCmd.SendObject , , , Me.EmailAddress, , , "Subject", "Body"
 
Hi Paul

Yeah, I could also get it to work with a hard-coded address and with VBA.

It sure would be nice to have an HTML version of the VBA method....any ideas?

Thanks
Regards
Greg
 
You could try this in VBA:

Application.FollowHyperlink "MailTo:" & Me.EmailAddress

Might need tweaking, as I'm not sure of the syntax for MailTo, but the idea is to build the hyperlink in code.
 
Thanks Paul,

I'll have a play an let you know.

Thanks
Regards
Greg
 
No problem Greg. It should work, it's just a matter of finding the correct syntax for the hyperlink, which you might be able to get from your button, concatenating the form reference where the hard-coded email address was.
 

Users who are viewing this thread

Back
Top Bottom