S
Southern at Heart
I made this sub() so that anytime I need to I can remove all the trailing
returns from any given field in a table. I need to pass 2 strings to it, the
name of the table & field. But it doesn't work. Can you not pass 2 things
to a sub?
Is there a way to make this work?
thanks.
Sub Remove_Trailing_Returns(Table As String, Field As String)
strSql = "UPDATE " & Table & " SET " & Table & "." & Field & " = Left(" & _
Field & ",Len(" & Field & ")-2) WHERE (((" & Table & "." & _
Field & ") Like ""*"" & Chr(13) & Chr(10)));"
Debug.Print strSql
DoCmd.RunSQL strSql
DoCmd.RunSQL strSql
DoCmd.RunSQL strSql
DoCmd.RunSQL strSql
DoCmd.RunSQL strSql
DoCmd.RunSQL strSql
DoCmd.RunSQL strSql
End Sub
returns from any given field in a table. I need to pass 2 strings to it, the
name of the table & field. But it doesn't work. Can you not pass 2 things
to a sub?
Is there a way to make this work?
thanks.
Sub Remove_Trailing_Returns(Table As String, Field As String)
strSql = "UPDATE " & Table & " SET " & Table & "." & Field & " = Left(" & _
Field & ",Len(" & Field & ")-2) WHERE (((" & Table & "." & _
Field & ") Like ""*"" & Chr(13) & Chr(10)));"
Debug.Print strSql
DoCmd.RunSQL strSql
DoCmd.RunSQL strSql
DoCmd.RunSQL strSql
DoCmd.RunSQL strSql
DoCmd.RunSQL strSql
DoCmd.RunSQL strSql
DoCmd.RunSQL strSql
End Sub