Go Premium for a chance to win a PS4. Enter to Win


How to Write a Program to Type Over a TextBox?

Posted on 2002-03-30
Medium Priority
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

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 60 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.


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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

972 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