I am trying to clean up some data that a client gave us. Right now the Building and Room # are in the same field and I want to split them apart. The Room number always beigns after the first 4 characters. I was trying to write a module to do this automatically. When I run the module I get a Compile error: Variable required - can't assign to this expresstion
and it highlights what is in blue below.
Sub RoomConverstion()
Dim rsStaff As New ADODB.Recordset
Dim intLen As Long
Dim strRoom As String
Dim strOldRoom As String
rsStaff.Open "Staff"
strRoom = ""
intLen = 4
Do Until rsStaff.EOF
strOldRoom = rsStaff![RMID]
strRoom = Right(strOldRoom, Len(strOldRoom - intLen))
rsStaff![Room #] = strRoom
Loop
End Sub
This is the first time I have tried something like this so if there is any suqqestions to the code I am open to them.
Thanks for the help.
and it highlights what is in blue below.
Sub RoomConverstion()
Dim rsStaff As New ADODB.Recordset
Dim intLen As Long
Dim strRoom As String
Dim strOldRoom As String
rsStaff.Open "Staff"
strRoom = ""
intLen = 4
Do Until rsStaff.EOF
strOldRoom = rsStaff![RMID]
strRoom = Right(strOldRoom, Len(strOldRoom - intLen))
rsStaff![Room #] = strRoom
Loop
End Sub
This is the first time I have tried something like this so if there is any suqqestions to the code I am open to them.
Thanks for the help.