Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Public Function CopyIt()
Dim db As Database
Dim rs As Recordset
Dim intPos As Integer 'Location of hyphen
Set db = CurrentDb
Set rs = db.OpenRecordset("table1", dbOpenDynaset)
With rs
Do While Not rs.EOF
'Find the position of the hyphen
intPos = InStr(1, rs!mytext, "-", 1)
.Edit
'Add the value to the right of the "-" to the next field
!mytext2 = Right(rs!mytext, (Len(rs!mytext) - intPos))
'Update the first field up to the hyphen
!mytext = Left(rs!mytext, intPos)
.Update
.MoveNext
Loop
End With
End Function
[/code/]
Note: If you want to remove the hyphen from the first field
replace !mytext = Left(rs!mytext, intPos) with
!mytext = Left(rs!mytext, (intPos - 1))
I hopes this helps.