1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Using VB6 to Create 'criteria query'

Discussion in 'Software Development' started by vaidehi, Feb 12, 2003.

Thread Status:
Not open for further replies.
  1. vaidehi

    vaidehi Thread Starter

    Joined:
    Feb 12, 2003
    Messages:
    1
    Hi, i am doin a A-level coursework, which requires me to use Visual Basic 6. The base tables are made in MS Access, and using these base tables, and the VB6 is used for creating the queries, navigation, forms and reports, and etc.

    i want to create a 'criteria query', this is when the user inputs what they want to be searched and can get the appropriate data.

    For Eg. i have a base table 'Supplier' whiich is made in Access 97 and this table stores personal information on the suppliers - such as name, address. I want to use VB6 to make a query on this table. the query is on the supplier name and their address.
    The end-user inputs the name of the supplier, to find their address info. Only the tables & the info on the supplier comes from Access, but the actual query in created in VB6. i having been using SQL to create my other queries, but i am unable to such queries.

    for the past 4 weeks, i have been trying to solve this problem, and have not succeeded . any HELP would be GREATLY APPRECIATED!!! Thanx

    pls.contact me on: [email protected]

    Vaidehi
     
  2. AbvAvgUser

    AbvAvgUser

    Joined:
    Oct 3, 2002
    Messages:
    2,281
    I feel I have a couple of books from where I can solve this problem. But I am not too sure about your problem.

    Can you please elaborate what your problem is? What have you tried to solve this problem? Who is the user of this program that you are creating? Is it another programmer or some actual end-user?
     
  3. TimCottee

    TimCottee

    Joined:
    Oct 10, 2001
    Messages:
    186
    The precise methodology varies depending on whether you are using ADO or DAO (or something else). However in principle you need to create a query like this:

    strSQLQuery = "Select * From Suppliers Where SupplierName Like '%" & strSupplierName & "%'

    If you are using DAO then you should replace the wildcard character % with *. This will return a list of suppliers that match the supplied string in part or in total.

    You can then retrieve the information required from the other fields as normal.
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Similar Threads - Using Create 'criteria
  1. adhya.arya
    Replies:
    2
    Views:
    494
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/118466

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice