Solved

Keep Focus On the Specific TextBox

Posted on 2008-06-11
3
173 Views
Last Modified: 2010-04-30
When the user fill the Textbox I want to check his information with the data base if is found I want to tell him Record found before then cancel the lostfocus . Where I can apply this code and how to to that
0
Comment
Question by:Ahmadal_najjar2003
[X]
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
3 Comments
 
LVL 16

Accepted Solution

by:
Robin earned 250 total points
ID: 21766478
In VB6, you can use the Textbox' Validate event.

e.g.:
The function CheckedInDatabase() should check the information in the database, and return True when ok,
and False when not ok.
Private Sub Text1_Validate(Cancel As Boolean)
    'check in database    
    If Not CheckedInDatabase(Text1.Text) Then
        Call MsgBox("Sorry, not found in database")
        Cancel = True
    End If
End Sub

Open in new window

0
 
LVL 70

Assisted Solution

by:Éric Moreau
Éric Moreau earned 250 total points
ID: 21767610
Be sure to set the CausesValidation to False on your Cancel or Exit button otherwise the user won't be even able to close the form.
0
 

Author Closing Comment

by:Ahmadal_najjar2003
ID: 31466436
Thanks A lot
0

Featured Post

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!

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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

734 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