hyperlink variable

  • Thread starter Thread starter flugal
  • Start date Start date
F

flugal

Guest
Hello all, this is my first post here, and what a better way to start than with a question!

I am working on a project for uni that is based on a real business (thus cannot name it), what I need to do is take a value determined via a query and use that as the mailto: in a hyperlink, ie, the user chooses the persons id on screen, the query then finds the persons email - I then need the new message window to open with that persons email.

I cannot get this to work no matter what I try, I was hoping some of you guys might have an idea - though according to the help files hyperlinks cannot be added to toolbar buttons or menu's that open lists, but thats just Access, I don't know if its possible to code it in VB...

I hope my description of the problem is understandable
 
eg. Create a form with

1. A label called "lbl_EmailAddress"

2. A Combo box called "fld_EmailList" which has two column of data, column 1 contains "UserName", column 2 contains "Email Address" - this can be a list or based on a query/table

3. Create the Event Procedure

Private Sub fld_EmailList_AfterUpdate()
Me.lbl_EmailAddress.HyperlinkAddress = "mailto:" & Me.fld_EmailList.Column(1) & "?subject=[Enter Subject]"
End Sub


This will change the hyperlink address of the label "lbl_EmailAddress" to the email address of the selected user, however you still have to click the hyperlink address to open an email window.


Hope this helps

Smed
 
Rather than using a query to find the email address, try using the Dlookup function (although the query will work just as well - the Dlookup makes the coding bit easier)
To send the email, you can use the followhyperlink method but I personally use the sendobject method. Look these up in help for an explanation how to use them and if you get stuck, get back.
 

Users who are viewing this thread

Back
Top Bottom