![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
A few years ago, I did something very stupid. Because I didn't know how to code in a carriage return on my website, and because the memo fields were displaying on my webpage without the carriage returns, I asked users of my site to use a double asterick ("**") to represent a new paragraph. Well, eventually, I learned how to code my database results, so that the carriage returns they put in the database, would display on the page. Only one issue remained. Deleting the double astericks in the database from the 10,000+ records. When I do my search/replace - I think it thinks I am using a wildcard, as it tells me the database has been searched and the item not found. I even tried enclosing the double astericks in quotations, but I still get the same error. Am I screwed? Mike |
#3
| |||
| |||
|
|
Mike: Don't despair. Copy the following code into a module: Public Sub FixDouble() Dim rs As DAO.Recordset Dim mstr, newstr, crlf As String Dim db As DAO.Database Set db = CurrentDb Set rs = db.OpenRecordset("tdouble") crlf = vbCrLf Do While Not rs.EOF rs.Edit mstr = rs("test") newstr = Replace(mstr, "**", crlf) rs("test") = newstr rs.Update rs.MoveNext Loop rs.Close Set rs = Nothing End Sub Replace the tablename (tdouble) with your table, and the field name (test) with your memo field name. Before you run this check in Tools/References that you have a DAO library checked. If not, find Microsoft DAO Library and check it. The replaces ** with CR/LF but you could use anything you want. Of course, make a copy of the db first. I tested this, but.... Good Luck Ira Solomon On Wed, 16 Feb 2005 22:30:19 -0800, "magmike" mike.klineDOESNT-LIKE-SPAM (AT) netterweb (DOT) com> wrote: A few years ago, I did something very stupid. Because I didn't know how to code in a carriage return on my website, and because the memo fields were displaying on my webpage without the carriage returns, I asked users of my site to use a double asterick ("**") to represent a new paragraph. Well, eventually, I learned how to code my database results, so that the carriage returns they put in the database, would display on the page. Only one issue remained. Deleting the double astericks in the database from the 10,000+ records. When I do my search/replace - I think it thinks I am using a wildcard, as it tells me the database has been searched and the item not found. I even tried enclosing the double astericks in quotations, but I still get the same error. Am I screwed? Mike |
![]() |
| Thread Tools | |
| Display Modes | |
| |