Oh I know what the problem is the coma's try this if it still gives you an error write a subroutine.
iff((Mid(homephone,4,1=""),(Mid(homephone,2,2) & Mid(homephone,6,10)), (Mid(homephone,2,4) & Mid(homephone,7,10)))
the subroutine will go something like this
sub updateit()
Dim dbs As Database
Dim rstSet As DAO.Recordset
Dim tmpPhone as string
set dbs=currentdb
set rstSet=dbs.OpenRecordset("tablename"
rstSet.MoveFirst
do until rstSet.EOF
rstSet.Edit
tmpPhone=rstSet![phonefield]
if Mid(tmpPhone,4,1="" then
rstSet![homephone]=Mid(tmpPhone,2,2) & Mid(tmpPhone,6,10)
else
rstSet![homephone]=Mid(tmpPhone,2,4) & Mid(tmpPhone,7,10)
rstSet.Update
rstSet.MoveNext
loop
oh oh I found another error
iff((Mid(homephone,4,1)="",(Mid(homephone,2,2) & Mid(homephone,6,10)), (Mid(homephone,2,4) & Mid(homephone,7,10)))
and in the subroutine change line
if Mid(tmpPhone,4,1="" then
to
if Mid(tmpPhone,4,1)="" then
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.