We have 2 databases that should have matching tables. I have an (In-Production) report that compares these fields and displays them to the user in an MS-Access form (continuous form style) for correction.
This is all well and good except it can be difficult to find the differences. How can I format these fields to bold/italicize/color the differences?
"The lazy dog jumped over a brown fox."
"The lazy dog jumped over the brown fox."
(It's easier to see the differences between 2 similiar text fields once they are highlighted in some way)
"The lazy dog jumped over a brown fox."
"The lazy dog jumped over the brown fox. "
Since we're talking about a form in MS Access, I don't have high hopes. But I know I'm not the first person to have this problem. Suggestions?
Edit
I've gone with Remou's solution. It's not my ideal solution, but it is "good enough", especially since I don't have any rich text options. In the query that builds the source table, I used space() to add trailing spaces to make both fields of equal length. Then I added this code to the Click event of both fields (with TextA and TextB reversed for the other field):
Dim i As Integer
For i = 1 To Len(Me.TextA.Text)
If Right(Left(Me.TextA.Value, i), 1) <> _
Right(Left(Me.TextB.Value, i), 1) Then
Me.TextA.SelStart = i - 1
Me.TextA.SelLength = Len(Me.TextA.Text)
Exit For
End If
Next i
The result is that when you click on each field, the first "differing letter" to the end of the string is selected. I was able to experiment, code, and text this quickly, so I went with it. But I'll be revisiting this idea sooner or later since this concept would be useful in several projects.