Martyh
Registered User.
- Local time
- Today, 02:12
- Joined
- May 2, 2000
- Messages
- 196
What have I forgotten ?
I have created a button on screen which goes thru all of my email names and gets the domain name from the Email. This is the code that I've used, except that the sub stops after going thru the first one. I am at a loss !! This should work -->> BUT !!
Whaat am I doing wrong ?
I have created a button on screen which goes thru all of my email names and gets the domain name from the Email. This is the code that I've used, except that the sub stops after going thru the first one. I am at a loss !! This should work -->> BUT !!
Whaat am I doing wrong ?
Code:
Private Sub DomainNamePlace_Click()
Dim dbs As Database
Dim rst As Recordset
Dim intRecordCount As Integer
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("SELECT * FROM tblContacts;")
rst.MoveFirst
If Not (rst.EOF) Then
With rst
.Edit
![Domain Name] = Right(!EmailName, Len(!EmailName) - InStr(!EmailName, "@"))
.Update
.MoveNext
End With
Else
MsgBox ("No more values!")
End If
rst.Close
Set dbs = Nothing
Exit_DomainNamePlace_Click:
Exit Sub
Err_DomainNamePlace_Click:
MsgBox Err.Description
Resume Exit_DomainNamePlace_Click
End Sub
Last edited by a moderator: