How to Write a Program to Type Over a TextBox?

Posted on 2002-03-30
Last Modified: 2010-05-02
I have been asked to write a program to type over a textbox .......To explain:
1>USER 1 Keys  in some data into the textbox,data gets stored into a database.
2>Since the data is Mission Critical I am required to:
  Display the previously entered data into textbox by
  User 1 as a shadow.  User 2 should be able to type over this and if there is a mismatch between User'1 n's data and User'2s data then a MsgBox should be displayed.  
Is this Possible?
(I have been told that this is the DeFacto Industry standard for Mission Critical DataEntry(Called as Shadow DataEntry or Double-Entry)is there any other method Pls.
Question by:soft_ware
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 6908487
You mean something like this?

If User1Text <> User2Text Then
  MsgBox "User1's text is not the same as User2's!"
End If

Please let me know if I am on the right track...

Expert Comment

ID: 6910203

I assume by 'shadow', that User 1's text in not visible to User 2.  That would only make sense.

So, when the User 1 data is stored in the db, it is also stored in a string variable, say sUser1Entry and is cleared from the textbox.  When User 2 makes his entry, he might click on a 'Confirm' button or just press Enter.  At this time, his entry is sored in a string variable sUser2Entry and cleared from the textbox.  Now the comparison between sUser1Entry and sUser2Entry is made as suggested by JonFish above.

LVL 22

Accepted Solution

rspahitz earned 15 total points
ID: 6910456
One way to address this is by tracking everything in the change event, where you can check keystroke-by-keystroke.  The problem with this is trying to deal with corrections while typing.

Probably a better way is to put something like JonFish85's code in the Validate event procedure:

Private sub Text1_Validate(Cancel as boolean)
   If User1Text <> User2Text Then
     msgbox "text does not match database", vbokonly
     Cancel = true
   End If
end sub
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Expert Comment

ID: 6916224
you may want to take the approach of having the previous user's entry appear in another color (red let's say) when the textbox pops up.  then as user2 types in the box, each character "typed over" turns a different color - say green - while the remaining characters are still red.  During this process or at the end, do your validation scheme.
LVL 16

Expert Comment

ID: 7754898

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in Community Support that this question is:
- points to rspahitz
Please leave any comments here within the
next seven days.

Expert Comment

ID: 7811935
per recommendation

Community Support Moderator @Experts Exchange

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question