Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2004

    Unanswered: query by example

    Hello there,

    I was wondering if its possible in Access 2003 on a from to implement a qbe(query by example) search.

    A dropdown box on, lets say a single table displaying one attribute.
    when the user now enters for example an "a" all values beginning with "a"should be listened in the drop down box.

    Is that possible? Any ideas? Thanks in advance for your help!!
    Regards Proximus

  2. #2
    Join Date
    Jun 2004
    Yep it can be done. Something like this I think:

    Private Sub Text2_AfterUpdate()
    Dim strSQL As String, qdf As QueryDef
    Set qdf = CurrentDb.QueryDefs("QueryName")

    strSQL = "SELECT [TableName].[FieldName]" & _
    " FROM [Tablename]" & _
    " WHERE ((([TableName].[FieldName]) Like '" & [textboxname] & "*'));"

    qdf.SQL = strSQL
    Me.(ComboboxName).Rowsource = "QueryName"
    End Sub
    Last edited by dwil2g1; 06-16-04 at 13:33.

  3. #3
    Join Date
    Jun 2003
    Actually in any combo box if one types in a letter such as "a" the combo box automatically scrolls down to the first entry that starts with that letter(s).
    J. Paul Schmidt, Freelance Web and Database Developer
    Access Database Sample, Web Database Sample, ASP Design Tips

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts