If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
replace http:// with mailto:
when entering an e-mail address on my form, Access 2000 changes it so that it
links to a webpage. How can I replace the "http://" with "mailto:" after update? |
#3
|
|||
|
|||
Tlaker,
Do you mean that Access is literally inserting a "http://" string in front of the data you are entering? I have not seen this before. As you have suggested, you will get the behaviour you seek if the mailto protocol identifier is used in your data. I would normally use code like this on the afterupdate event of the control... If Me.Email Like "mailto:*" Then ' do nothing Else Me.Email = "mailto:" & Me.Email End If But this assumes the code is just working with the text you entered. If you literally have a http identifier there, try it like this... If Me.Email Like "mailto:*" Then ' do nothing ElseIf Me.Email Like "http*" Then Me.Email = Replace(Me.Email,"http://","mailto:") Else Me.Email = "mailto:" & Me.Email End If -- Steve Schapel, Microsoft Access MVP tlaker wrote: when entering an e-mail address on my form, Access 2000 changes it so that it links to a webpage. How can I replace the "http://" with "mailto:" after update? |
#4
|
|||
|
|||
thanks Jeff, I'll give it a try
"Jeff Conrad" wrote: "tlaker" wrote in message: ... when entering an e-mail address on my form, Access 2000 changes it so that it links to a webpage. How can I replace the "http://" with "mailto:" after update? Hi, It sounds like you have the table field defined to be a Hyperlink field. I would set the field to be a text field, not Hyperlink to avoid this problem. Here is a past post of mine on this issue which details how to avoid the problem you are having, as well as how to send the person an e-mail message by double clicking on that form field. 1. Make a field in the table called EmailAddress set as Text (not hyperlink). 2. Enter the e-mail addresses like so on the data entry form: They will not have to type the "mailto" part 3. Code the double-click event of that field's control on the data entry form like so: Private Sub EmailAddress_DblClick(Cancel As Integer) On Error GoTo ErrorPoint Dim strEmail As String ' Stop the Web Toolbar from appearing DoCmd.ShowToolbar "Web", acToolbarNo If Not IsNull(Me.EmailAddress) Then strEmail = Me.EmailAddress If Left(strEmail, 7) "mailto:" Then strEmail = "mailto: " & strEmail End If Application.FollowHyperlink strEmail End If ExitPoint: Exit Sub ErrorPoint: MsgBox "The following error has occurred:" _ & vbNewLine & "Error Number: " & Err.Number _ & vbNewLine & "Error Description: " _ & Err.Description, vbExclamation, _ "Unexpected Error" Resume ExitPoint End Sub Double-clicking on that field will bring up Outlook (assuming that is what you are using) with a new message and their e-mail address already filled in. Hope that gets you going, -- Jeff Conrad Access Junkie Bend, Oregon |
#5
|
|||
|
|||
"tlaker" wrote in message:
... thanks Jeff, I'll give it a try You're welcome, good luck with your project. -- Jeff Conrad Access Junkie Bend, Oregon |
#6
|
|||
|
|||
"if you type , what is actually stored in the database is #a href="http://...xample.com/a# " http://support.microsoft.com/default...b;en-us;323202 HOW TO: Change the Values in a Hyperlink Field from an HTTP Address to a MAILTO Address in Microsoft Access 2000 (david) "Steve Schapel" wrote in message ... Tlaker, Do you mean that Access is literally inserting a "http://" string in front of the data you are entering? I have not seen this before. As you have suggested, you will get the behaviour you seek if the mailto protocol identifier is used in your data. I would normally use code like this on the afterupdate event of the control... If Me.Email Like "mailto:*" Then ' do nothing Else Me.Email = "mailto:" & Me.Email End If But this assumes the code is just working with the text you entered. If you literally have a http identifier there, try it like this... If Me.Email Like "mailto:*" Then ' do nothing ElseIf Me.Email Like "http*" Then Me.Email = Replace(Me.Email,"http://","mailto:") Else Me.Email = "mailto:" & Me.Email End If -- Steve Schapel, Microsoft Access MVP tlaker wrote: when entering an e-mail address on my form, Access 2000 changes it so that it links to a webpage. How can I replace the "http://" with "mailto:" after update? |
#7
|
|||
|
|||
Thanks, David, I have learned something here.
-- Steve Schapel, Microsoft Access MVP david epsom dot com dot au wrote: "if you type , what is actually stored in the database is #a href="http://...xample.com/a# " http://support.microsoft.com/default...b;en-us;323202 HOW TO: Change the Values in a Hyperlink Field from an HTTP Address to a MAILTO Address in Microsoft Access 2000 (david) |
#8
|
|||
|
|||
replace http:// with mailto:
This code to create an email by double clicking is great! Can code be added
so that not only will it fill in the email address, it will fill in the subject line and message body based on two separate text fields that I already have populated? "Jeff Conrad" wrote: "tlaker" wrote in message: ... when entering an e-mail address on my form, Access 2000 changes it so that it links to a webpage. How can I replace the "http://" with "mailto:" after update? Hi, It sounds like you have the table field defined to be a Hyperlink field. I would set the field to be a text field, not Hyperlink to avoid this problem. Here is a past post of mine on this issue which details how to avoid the problem you are having, as well as how to send the person an e-mail message by double clicking on that form field. 1. Make a field in the table called EmailAddress set as Text (not hyperlink). 2. Enter the e-mail addresses like so on the data entry form: They will not have to type the "mailto" part 3. Code the double-click event of that field's control on the data entry form like so: Private Sub EmailAddress_DblClick(Cancel As Integer) On Error GoTo ErrorPoint Dim strEmail As String ' Stop the Web Toolbar from appearing DoCmd.ShowToolbar "Web", acToolbarNo If Not IsNull(Me.EmailAddress) Then strEmail = Me.EmailAddress If Left(strEmail, 7) "mailto:" Then strEmail = "mailto: " & strEmail End If Application.FollowHyperlink strEmail End If ExitPoint: Exit Sub ErrorPoint: MsgBox "The following error has occurred:" _ & vbNewLine & "Error Number: " & Err.Number _ & vbNewLine & "Error Description: " _ & Err.Description, vbExclamation, _ "Unexpected Error" Resume ExitPoint End Sub Double-clicking on that field will bring up Outlook (assuming that is what you are using) with a new message and their e-mail address already filled in. Hope that gets you going, -- Jeff Conrad Access Junkie Bend, Oregon |
#9
|
|||
|
|||
replace http:// with mailto:
To update many email at once in 2003 create an update query. In design type
'a href="mailto:'+[email]+'"'+[email]+'/a' in Update To:. It will then update your table. "tlaker" wrote: when entering an e-mail address on my form, Access 2000 changes it so that it links to a webpage. How can I replace the "http://" with "mailto:" after update? |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
loop for replace function | luzippu | Running & Setting Up Queries | 2 | March 24th, 2005 10:13 AM |
Find and Replace anomaly | BruceM | General Discussion | 7 | January 18th, 2005 05:47 PM |
Find and Replace in Word 97 | Doug Robbins - Word MVP | General Discussion | 1 | May 28th, 2004 02:41 PM |
find all / replace all used in a selected range | oldguy | Worksheet Functions | 0 | February 26th, 2004 01:05 PM |