Hi,
NOTE: I couldn't post this question cause this is my 2nd post and I can not post links so that's why I had to add the "-" in between the "ht-tp://" and "ww-w" Please read through this I know it's very stupid but I had to do this or either spam somewhere on the site :banghead:
For some of you this is gonna be a real easy question but I'm new to access and VBA and get figure this one out.
The problem is that for our website textbox button to work the address has to start with "ht-tp://" while my co-workers address websites with just "ww-w." So I had to find out how we can replace or add the ht-tp in front. It doesn't really matter how this is done as long as it works.
The things I've tried are:
This is when is clicked on a button next to the textbox:
And this one on the same button:
Last try was this after update event on the textbox itself:
Thanks for giving this any thought at all 
Sincerely,
MartynE
Note: I work in Access 2003 on a Windows 7 machine.
NOTE: I couldn't post this question cause this is my 2nd post and I can not post links so that's why I had to add the "-" in between the "ht-tp://" and "ww-w" Please read through this I know it's very stupid but I had to do this or either spam somewhere on the site :banghead:
For some of you this is gonna be a real easy question but I'm new to access and VBA and get figure this one out.
The problem is that for our website textbox button to work the address has to start with "ht-tp://" while my co-workers address websites with just "ww-w." So I had to find out how we can replace or add the ht-tp in front. It doesn't really matter how this is done as long as it works.
The things I've tried are:
This is when is clicked on a button next to the textbox:
Code:
Dim strPhrase As String
Dim strOldWord As String
Dim strNewWord As String
strPhrase = "Me.[website]"
strOldWord = "ww-w."
strNewWord = "ht-tp://ww-w."
strPhrase = Replace(strPhrase, strOldWord, strNewWord, 1, -1)
Code:
If Left([website], 3) = "ww-w" Then
Replace("Me.[website]", "ww-w.", "ht-tp://")
Else
End If
Code:
Private Sub website_AfterUpdate()
If Left([website], 3) = "w-ww" Then
Left([website], 10) = "ht-tp://ww-w"
Else
End If

Sincerely,
MartynE
Note: I work in Access 2003 on a Windows 7 machine.
Last edited: