1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| Sub Mobile1()
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim fld As DAO.Field
Dim Update As String
Update = "dbo_clients"
Set db = CurrentDb()
Set rst = db.OpenRecordset(Update)
While rst.EOF = False
If IsNull(rst("mobile1")) Then GoTo Drop
rst.Edit
rst("mobile1") = Replace(rst("mobile1"), ".", "")
rst("mobile1") = Replace(rst("mobile1"), " ", "")
rst("mobile1") = Replace(rst("mobile1"), "-", "")
rst("mobile1") = Replace(rst("mobile1"), "/", "")
If Left(rst("mobile1"), 1) = "+" Then
GoTo Drop
Else
If Len(rst("mobile1")) = 10 Then
rst.Edit
rst("mobile1") = "+33" & Right(rst("mobile1"), 9)
rst.Update
ElseIf Len(rst("mobile1")) = 9 Then
rst.Edit
rst("mobile1") = "+33" & rst("mobile1")
rst.Update
End If
End If
Drop:
rst.MoveNext
Wend
rst.Close
Set rst = Nothing
Set db = Nothing
End Sub |
Partager