Kevin-
MyString is just a variable you declared, and it will be empty when you call this code.
Why do you want to replace the # in the Website field? If it is defined as a Hyperlink data type, then it can contain up to four parts delimited with "#".
Display Text#Hyperlink address#Sub address#Tool tip
So, a Hyperlink might look like:
Recommended Reading#http://www.viescas.com/category/goodreads/##Click to see book recommendations
The second part is at the actual hyperlink, and if there was a bookmark on the page that the link needed to go to, it would be in the third part. When you look at this displayed in a Text Box, you will see "Recommended Reading" displayed. If you hover over the control, a tip will pop up displaying "Click to see book recommendations".
If you really want to replace the # characters, your code should be:
Me.Website = Replace(Me.Website, "#", " ")
John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
(Paris, France)
On Dec 14, 2015, at 9:43 AM, 'zhaoliqingoffice@163.com' zhaoliqingoffice@163.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
Dear All,
I want to remove the "#" from the webaddress, I use Replace function. the code is like this:
Private Sub Command45_Click()
Dim MyString As String
MyString = Replace(Me.Website, "#", " ")
End Sub
Dim MyString As String
MyString = Replace(Me.Website, "#", " ")
End Sub
After clicking the command button, nothing happened. What's wrong with the code? Thanks!
Best Regards,
Kevin
__._,_.___
Posted by: John Viescas <johnv@msn.com>
| Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (5) |
.
__,_._,___
Tidak ada komentar:
Posting Komentar