Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Keep Focus On the Specific TextBox

Posted on 2008-06-11
3
Medium Priority
?
179 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 1000 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 1000 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

610 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