Top DevX Stories
Creating Custom Export Filters for StarOffice with XSLT
WPF Wonders: Using DataTemplates
Crystal Reports Family Offers Options for Developers
Avaya Aura Session Manager video
Avaya Aura Overview video
Search the forums:

Go Back   DevX.com Forums > DevX Developer Forums > VB Classic

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 11-01-2009, 01:30 AM
hwkong1688 hwkong1688 is offline
Registered User
 
Join Date: Jul 2009
Location: Malaysia
Posts: 11
Question How to use findfirst method to search database number one by one number index field

Hi all friend,
im new in vb, can anyone help me how to write the code for findfirst method by index number.

example
when i key in one by one number in field will search one by one number in list DBgrib1.


Code:
Private Sub Search_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 Then
Data1.Recordset.FindFirst "[barcode] like '" + Search + "*'"
Search.Text = UCase(Search.Text)
If Data1.Recordset.NoMatch Then
MsgBox "Barcode number Not Found"

End If

Search.SelStart = 0
Search.SelLength = Len(Search.Text)

End If

If KeyAscii = 27 Then

Unload Me
Form1.Visible = True

End If

    num = InStr("1234567890" & Chr(8), Chr(KeyAscii))
    If num = 0 Then
        KeyAscii = 0
    End If

End Sub

Reply With Quote
  #2  
Old 11-02-2009, 08:40 AM
Hack's Avatar
Hack Hack is offline
Super Moderator
 
Join Date: Apr 2007
Location: Sterling Heights, Michigan
Posts: 7,719
Are you searching your database (what database are you using) or your grid?
__________________
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
Please use [Code]your code goes in here[/Code] tags when posting code.
Before posting your question, did you look here?
Got a question on Linux? Visit our Linux sister site.
Modifications Required For VB6 Apps To Work On Vista

Microsoft MVP 2005/2006/2007/2008/2009
Reply With Quote
  #3  
Old 11-02-2009, 09:18 AM
hwkong1688 hwkong1688 is offline
Registered User
 
Join Date: Jul 2009
Location: Malaysia
Posts: 11
Question Searching database one by one number

hi friend, i using the microsoft access, i want to search dbgrib.

pls help.thx

Last edited by hwkong1688; 11-02-2009 at 09:20 AM.
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Performance Issue Using Full Text Search naveensingh Database 0 02-14-2009 09:59 AM
Retrieve binary field from SQL Server 2000 database into plain html ? Nenad Kermeci ASP.NET 0 11-12-2002 11:39 AM
Inserting Checkboxes Into Yes/No Field In Access Database (JavaScript) Cindy ASP.NET 2 03-15-2002 03:08 PM
how to search a database help me achyuth ASP.NET 1 12-01-2000 10:37 AM


All times are GMT -4. The time now is 10:58 PM.


Sponsored Links



Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.