[AccessD] Re: Break Name

Robert L. Stewart rl_stewart at highstream.net
Wed Jan 21 14:41:05 CST 2004


See changes below:

At 12:00 PM 1/21/2004 -0600, you wrote:
>Public Function BreakName()
>
>
>'Separate The Name field to Firs and LastName and ProperCase it
>'Uses MDL-Proper Module
>
>
>MsgBox ("hey")
>Dim db As DAO.Database
>Dim rs As DAO.Recordset
>Set db = CurrentDb
>
>Dim strLine As String
>Dim strSQL1 As String
>Dim strFName As String
>Dim strLName As String
>Dim a As Integer
>
>
>strSQL1 = "Select * From [emp table1]"
>Set rs = db.OpenRecordset(strSQL1)
>
>
>Do Until rs.EOF
>   strLine = rs("Employee Name")
>   '
>   strLine = Proper(strLine)
>   a = InStr(strLine, ",")
>   strFName = Mid(strLine, a + 2)
>   strLName = Left(strLine, a - 1)
>
>   'rs(0) = strLine
    rs.edit
       rs!Fname = strfname
       rs!Lname = strLname
    rs.update

>   rs.MoveNext
>Loop
>
>    MsgBox ("end")
>
>End Function

Robert




More information about the AccessD mailing list