Best Approach

User avatar
burrina
4StarLounger
Posts: 550
Joined: 30 Jul 2014, 23:58

Best Approach

Post by burrina »

As a continuation of Bad Words, this issue has come up. Your advice Please.

Dim strOldValue As String
strOldValue=me!"txtmsg.value
If Me.strOldValue <> Me.txtmsg Then
MsgBox "You have not edited your message" , "Please Change Wording!"
Exit Sub
End If

Or I could check character count and store old value in textbox
What is your reccomendation?
Object is to see if they have changed the bad word(s) found and if so they can send, else no.

Or Cancel Save!

Best approach Please...

User avatar
StuartR
Administrator
Posts: 12604
Joined: 16 Jan 2010, 15:49
Location: London, Europe

Re: Best Approach

Post by StuartR »

I think that this whole approach is doomed to fail. At some point in the process you have to trust people, otherwise you are going to prevent them from working efficiently.
StuartR


User avatar
HansV
Administrator
Posts: 78457
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Best Approach

Post by HansV »

I agree with Stuart, but if you really want to prevent bad words, you should check for them in the Before Update event of txtmsg, and set Cancel to True if the message contains bad words. That way, the user won't be able to exit the text box until they have been removed.
Best wishes,
Hans

User avatar
burrina
4StarLounger
Posts: 550
Joined: 30 Jul 2014, 23:58

Re: Best Approach

Post by burrina »

I have already coded for variables with some pretty good code if do say so myself. Since this post I resolved the issue. Sometimes its good to think out loud.

Thanks,
P.S. Wrote a whole module to deal with bad words.
Project is 100% not a failure. 2 field name project turns into a challenge but not one that is impossible.

User avatar
HansV
Administrator
Posts: 78457
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Best Approach

Post by HansV »

Good to hear that!
Best wishes,
Hans