PC Review


Reply
Thread Tools Rate Thread

Comparing memo fields, and displaying differences

 
 
Dale Fye
Guest
Posts: n/a
 
      17th Sep 2009
I've got an application where I track changes to a specific memo field,
saving the previous version to a History table. One of my users has asked if
I can create a form where he can pull up the previous version, and the new
version for comparison. Obviously no sweat, so far. But what he really
wants is to be able to look at the form, and see what has changed from the
original to the new version (sort of like tracking changes in word).

My thought is to use a text box set to Rich Text for the latest version, and
compare the two strings word by word, when a difference occurs, insert a html
tag to change the color in the new version. I know this method is frought
with pitfalls, so I was wondering whether anybody has done something similar
and could provide some tips.

------
Dale

 
Reply With Quote
 
 
 
 
Jack Leach
Guest
Posts: n/a
 
      17th Sep 2009
I'm not sure if you could make it work, but I use a program called WinDiff to
compare two text files. It shows the line numbers/highlights changes, etc.
Pretty handy actually.

I'm thinking maybe you could export the memo to a text file, but I don't
know how you'd get around the lack of word wrapping (maybe to an rft? I'm not
sure if WinDiff works with it)...

Anyway, it might be worth looking into, may save lots of time trying to
re-write a comparison module if no one else has any ideas.

--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)



"Dale Fye" wrote:

> I've got an application where I track changes to a specific memo field,
> saving the previous version to a History table. One of my users has asked if
> I can create a form where he can pull up the previous version, and the new
> version for comparison. Obviously no sweat, so far. But what he really
> wants is to be able to look at the form, and see what has changed from the
> original to the new version (sort of like tracking changes in word).
>
> My thought is to use a text box set to Rich Text for the latest version, and
> compare the two strings word by word, when a difference occurs, insert a html
> tag to change the color in the new version. I know this method is frought
> with pitfalls, so I was wondering whether anybody has done something similar
> and could provide some tips.
>
> ------
> Dale
>

 
Reply With Quote
 
John Spencer
Guest
Posts: n/a
 
      17th Sep 2009
To do this at all would take a major programming effort.
Highlighting the FIRST change would be simple, highlighting all the changes
would be much more difficult.

For example:
Line one in tableA
Now is the time for good men to come to the party and country [string ended]

Line one in tableB
Nom is the time for all good men to come to the party country and there are
lots more words after this

Changes:
First word Now vs Nom
Do you highlight the WORD or do you highlight the letter.

Word added after "for" so now all words in from word 6 on differ until we get
to Country where the words are in synch again. However note that the string
"good men to come to the party" is not a change.

And All the extended text would be highlighted.

Easier might be to export the strings to two separate Word documents and use
the Word's ability to compare the two strings. Perhaps you could then extract
the compared information and get it into a rich text field/control.

NomNow is the time for all good men to come to the party and country and there
are lots more words after this.

In the above Nom is struck through, Now is underlined, all is struck through,
"and" is underlined, all the trailing words after country are struck through.

Good luck.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Dale Fye wrote:
> I've got an application where I track changes to a specific memo field,
> saving the previous version to a History table. One of my users has asked if
> I can create a form where he can pull up the previous version, and the new
> version for comparison. Obviously no sweat, so far. But what he really
> wants is to be able to look at the form, and see what has changed from the
> original to the new version (sort of like tracking changes in word).
>
> My thought is to use a text box set to Rich Text for the latest version, and
> compare the two strings word by word, when a difference occurs, insert a html
> tag to change the color in the new version. I know this method is frought
> with pitfalls, so I was wondering whether anybody has done something similar
> and could provide some tips.
>
> ------
> Dale
>

 
Reply With Quote
 
Dale Fye
Guest
Posts: n/a
 
      17th Sep 2009
John,

I know! Thus my statement " I know this method is frought
with pitfalls".

For now, my thought is to highlight the word, not the character. I'm still
trying to figure out how to do a strikethrough in an RTF enabled textbox.

I found all sorts of compare text utilities in a web search, but all
appeared to be freeware, or a comercial product. Didn't find any code
examples.

----
Dale



"John Spencer" wrote:

> To do this at all would take a major programming effort.
> Highlighting the FIRST change would be simple, highlighting all the changes
> would be much more difficult.
>
> For example:
> Line one in tableA
> Now is the time for good men to come to the party and country [string ended]
>
> Line one in tableB
> Nom is the time for all good men to come to the party country and there are
> lots more words after this
>
> Changes:
> First word Now vs Nom
> Do you highlight the WORD or do you highlight the letter.
>
> Word added after "for" so now all words in from word 6 on differ until we get
> to Country where the words are in synch again. However note that the string
> "good men to come to the party" is not a change.
>
> And All the extended text would be highlighted.
>
> Easier might be to export the strings to two separate Word documents and use
> the Word's ability to compare the two strings. Perhaps you could then extract
> the compared information and get it into a rich text field/control.
>
> NomNow is the time for all good men to come to the party and country and there
> are lots more words after this.
>
> In the above Nom is struck through, Now is underlined, all is struck through,
> "and" is underlined, all the trailing words after country are struck through.
>
> Good luck.
>
> John Spencer
> Access MVP 2002-2005, 2007-2009
> The Hilltop Institute
> University of Maryland Baltimore County
>
> Dale Fye wrote:
> > I've got an application where I track changes to a specific memo field,
> > saving the previous version to a History table. One of my users has asked if
> > I can create a form where he can pull up the previous version, and the new
> > version for comparison. Obviously no sweat, so far. But what he really
> > wants is to be able to look at the form, and see what has changed from the
> > original to the new version (sort of like tracking changes in word).
> >
> > My thought is to use a text box set to Rich Text for the latest version, and
> > compare the two strings word by word, when a difference occurs, insert a html
> > tag to change the color in the new version. I know this method is frought
> > with pitfalls, so I was wondering whether anybody has done something similar
> > and could provide some tips.
> >
> > ------
> > Dale
> >

>

 
Reply With Quote
 
Paul Shapiro
Guest
Posts: n/a
 
      17th Sep 2009
The simplest I can see is to identify the start of the differences (first
character that doesn't match) and the end of the differences (first
character from the right that doesn't match. You could highlight everything
between those 2 locations.

I've thought about this issue before too, and I've considered writing code
to have Word display the differences. It does a nice job, and I don't think
it's nearly as much code to automate Word as it would be to do an equally
good job.

"Dale Fye" <(E-Mail Removed)> wrote in message
news:ED965B4B-5B40-4007-A825-(E-Mail Removed)...
> John,
>
> I know! Thus my statement " I know this method is frought
> with pitfalls".
>
> For now, my thought is to highlight the word, not the character. I'm
> still
> trying to figure out how to do a strikethrough in an RTF enabled textbox.
>
> I found all sorts of compare text utilities in a web search, but all
> appeared to be freeware, or a comercial product. Didn't find any code
> examples.
>
> ----
> Dale
>
>
>
> "John Spencer" wrote:
>
>> To do this at all would take a major programming effort.
>> Highlighting the FIRST change would be simple, highlighting all the
>> changes
>> would be much more difficult.
>>
>> For example:
>> Line one in tableA
>> Now is the time for good men to come to the party and country [string
>> ended]
>>
>> Line one in tableB
>> Nom is the time for all good men to come to the party country and there
>> are
>> lots more words after this
>>
>> Changes:
>> First word Now vs Nom
>> Do you highlight the WORD or do you highlight the letter.
>>
>> Word added after "for" so now all words in from word 6 on differ until we
>> get
>> to Country where the words are in synch again. However note that the
>> string
>> "good men to come to the party" is not a change.
>>
>> And All the extended text would be highlighted.
>>
>> Easier might be to export the strings to two separate Word documents and
>> use
>> the Word's ability to compare the two strings. Perhaps you could then
>> extract
>> the compared information and get it into a rich text field/control.
>>
>> NomNow is the time for all good men to come to the party and country and
>> there
>> are lots more words after this.
>>
>> In the above Nom is struck through, Now is underlined, all is struck
>> through,
>> "and" is underlined, all the trailing words after country are struck
>> through.
>>
>> Good luck.
>>
>> John Spencer
>> Access MVP 2002-2005, 2007-2009
>> The Hilltop Institute
>> University of Maryland Baltimore County
>>
>> Dale Fye wrote:
>> > I've got an application where I track changes to a specific memo field,
>> > saving the previous version to a History table. One of my users has
>> > asked if
>> > I can create a form where he can pull up the previous version, and the
>> > new
>> > version for comparison. Obviously no sweat, so far. But what he
>> > really
>> > wants is to be able to look at the form, and see what has changed from
>> > the
>> > original to the new version (sort of like tracking changes in word).
>> >
>> > My thought is to use a text box set to Rich Text for the latest
>> > version, and
>> > compare the two strings word by word, when a difference occurs, insert
>> > a html
>> > tag to change the color in the new version. I know this method is
>> > frought
>> > with pitfalls, so I was wondering whether anybody has done something
>> > similar
>> > and could provide some tips.
>> >
>> > ------
>> > Dale
>> >

>>


 
Reply With Quote
 
ryguy7272
Guest
Posts: n/a
 
      18th Sep 2009
Good one, Jack! Dale, try this:
http://download.cnet.com/Diff-Doc-Pr...-10208058.html

HTH,
Ryan---

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Paul Shapiro" wrote:

> The simplest I can see is to identify the start of the differences (first
> character that doesn't match) and the end of the differences (first
> character from the right that doesn't match. You could highlight everything
> between those 2 locations.
>
> I've thought about this issue before too, and I've considered writing code
> to have Word display the differences. It does a nice job, and I don't think
> it's nearly as much code to automate Word as it would be to do an equally
> good job.
>
> "Dale Fye" <(E-Mail Removed)> wrote in message
> news:ED965B4B-5B40-4007-A825-(E-Mail Removed)...
> > John,
> >
> > I know! Thus my statement " I know this method is frought
> > with pitfalls".
> >
> > For now, my thought is to highlight the word, not the character. I'm
> > still
> > trying to figure out how to do a strikethrough in an RTF enabled textbox.
> >
> > I found all sorts of compare text utilities in a web search, but all
> > appeared to be freeware, or a comercial product. Didn't find any code
> > examples.
> >
> > ----
> > Dale
> >
> >
> >
> > "John Spencer" wrote:
> >
> >> To do this at all would take a major programming effort.
> >> Highlighting the FIRST change would be simple, highlighting all the
> >> changes
> >> would be much more difficult.
> >>
> >> For example:
> >> Line one in tableA
> >> Now is the time for good men to come to the party and country [string
> >> ended]
> >>
> >> Line one in tableB
> >> Nom is the time for all good men to come to the party country and there
> >> are
> >> lots more words after this
> >>
> >> Changes:
> >> First word Now vs Nom
> >> Do you highlight the WORD or do you highlight the letter.
> >>
> >> Word added after "for" so now all words in from word 6 on differ until we
> >> get
> >> to Country where the words are in synch again. However note that the
> >> string
> >> "good men to come to the party" is not a change.
> >>
> >> And All the extended text would be highlighted.
> >>
> >> Easier might be to export the strings to two separate Word documents and
> >> use
> >> the Word's ability to compare the two strings. Perhaps you could then
> >> extract
> >> the compared information and get it into a rich text field/control.
> >>
> >> NomNow is the time for all good men to come to the party and country and
> >> there
> >> are lots more words after this.
> >>
> >> In the above Nom is struck through, Now is underlined, all is struck
> >> through,
> >> "and" is underlined, all the trailing words after country are struck
> >> through.
> >>
> >> Good luck.
> >>
> >> John Spencer
> >> Access MVP 2002-2005, 2007-2009
> >> The Hilltop Institute
> >> University of Maryland Baltimore County
> >>
> >> Dale Fye wrote:
> >> > I've got an application where I track changes to a specific memo field,
> >> > saving the previous version to a History table. One of my users has
> >> > asked if
> >> > I can create a form where he can pull up the previous version, and the
> >> > new
> >> > version for comparison. Obviously no sweat, so far. But what he
> >> > really
> >> > wants is to be able to look at the form, and see what has changed from
> >> > the
> >> > original to the new version (sort of like tracking changes in word).
> >> >
> >> > My thought is to use a text box set to Rich Text for the latest
> >> > version, and
> >> > compare the two strings word by word, when a difference occurs, insert
> >> > a html
> >> > tag to change the color in the new version. I know this method is
> >> > frought
> >> > with pitfalls, so I was wondering whether anybody has done something
> >> > similar
> >> > and could provide some tips.
> >> >
> >> > ------
> >> > Dale
> >> >
> >>

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Comparing Memo fields ccgreenman Microsoft Access VBA Modules 0 21st Jan 2010 11:12 PM
Comparing memo fields, and displaying differences Dale Fye Microsoft Access 5 18th Sep 2009 07:26 PM
Memo fields not displaying in query sfdalmom Microsoft Access Queries 4 12th Aug 2009 07:16 PM
comparing 2 fields/cells and displaying a message programitcally =?Utf-8?B?cXVlc3Rpb24xMg==?= Microsoft Excel Programming 1 29th Jan 2007 04:27 PM
Comparing two fields and displaying difference if text is present. Alex Microsoft Excel Misc 2 17th Mar 2004 10:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:13 AM.