search in vb 6.0

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jeroen van vliet

    search in vb 6.0

    Hello

    I am still a newbie and I have an access dbase. I want to create a textbox
    where i can type in the first letter of a name, so that the appropriate
    names starting with the first letter will be shown. for example you type an
    A you will get all the names starting with A in the datagrid box. How can i
    do this?

    Jeroen


  • MooVBuff

    #2
    Re: search in vb 6.0

    This works with a combo box so I see no reason you couldn't use it with
    another control.

    'Place the following in the declaration section of your form:

    Private Declare Function SendMessage Lib "user32" Alias "SendMessag eA"
    (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As
    Any) As Long


    'Place the following function in your form code:

    Public Function dropme(cb As Object)
    Const CB_SHOWDROPDOWN = &H14F
    Dim Tmp As String
    Tmp = SendMessage(cb. hwnd, CB_SHOWDROPDOWN , 1, ByVal 0&)
    End Function

    'Now pass the function to the Combo box in the Get focus procedure.

    Private Sub Combo1_GotFocus ()
    dropme Combo1
    End Sub


    "Jeroen van vliet" <info@education alstays.com> wrote in message
    news:bjkqpp$6$1 @reader10.wxs.n l...[color=blue]
    > Hello
    >
    > I am still a newbie and I have an access dbase. I want to create a textbox
    > where i can type in the first letter of a name, so that the appropriate
    > names starting with the first letter will be shown. for example you type[/color]
    an[color=blue]
    > A you will get all the names starting with A in the datagrid box. How can[/color]
    i[color=blue]
    > do this?
    >
    > Jeroen
    >
    >[/color]


    Comment

    • Jeroen van vliet

      #3
      Re: search in vb 6.0

      Thanks very much, but how do i use this for the textbox??
      "MooVBuff" <edoepke@comcas t.net> schreef in bericht
      news:I_6dnTUuEf _bzsOiXTWJkw@co mcast.com...[color=blue]
      > This works with a combo box so I see no reason you couldn't use it with
      > another control.
      >
      > 'Place the following in the declaration section of your form:
      >
      > Private Declare Function SendMessage Lib "user32" Alias "SendMessag eA"
      > (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As
      > Any) As Long
      >
      >
      > 'Place the following function in your form code:
      >
      > Public Function dropme(cb As Object)
      > Const CB_SHOWDROPDOWN = &H14F
      > Dim Tmp As String
      > Tmp = SendMessage(cb. hwnd, CB_SHOWDROPDOWN , 1, ByVal 0&)
      > End Function
      >
      > 'Now pass the function to the Combo box in the Get focus procedure.
      >
      > Private Sub Combo1_GotFocus ()
      > dropme Combo1
      > End Sub
      >
      >
      > "Jeroen van vliet" <info@education alstays.com> wrote in message
      > news:bjkqpp$6$1 @reader10.wxs.n l...[color=green]
      > > Hello
      > >
      > > I am still a newbie and I have an access dbase. I want to create a[/color][/color]
      textbox[color=blue][color=green]
      > > where i can type in the first letter of a name, so that the appropriate
      > > names starting with the first letter will be shown. for example you type[/color]
      > an[color=green]
      > > A you will get all the names starting with A in the datagrid box. How[/color][/color]
      can[color=blue]
      > i[color=green]
      > > do this?
      > >
      > > Jeroen
      > >
      > >[/color]
      >
      >[/color]


      Comment

      Working...