Results 1 to 12 of 12

Thread: I am posting it again

  1. #1

    Thread Starter
    Addicted Member Lina229's Avatar
    Join Date
    Sep 2001
    Location
    Guess !!!
    Posts
    157

    Post I am posting it again

    Slecting a field then retrieving the specified records. [U]

    How i can search my database by entering some value in one of my controls ???


    say forexample that i have 2 textboxes and 2 combo's and 5 listboxes

    if i entered a value in one of these controls ... and when i press Find Command Button .. i should retrieve the specified record

    this is one questin ...
    actually i have alot of questions .... i will post the rest of my questions later on ...step by step ...

    i know that i am asking too much these days
    p.s1. i am using access database ...and i am not using adobconnection.
    p.s2. and if i have several records that match the same criteria i had entered ... how i can manage/view these records ? using Next/Previous record ? Right ?

    Have a nice day all ...
    Where Ignorance Is Bliss , It's Folly To Be Wise
    ---------------------------------------------
    -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.

    Best Regards;
    Lina

  2. #2
    Addicted Member E-Link's Avatar
    Join Date
    Nov 2001
    Location
    INA
    Posts
    242
    if u use data control
    in the event click command button u type this code:

    Code:
    data1.recordsource = "select * from table1 where field1 = " & text1.text
    data1.referesh
    to view all result , u can use data grid.


  3. #3
    Hyperactive Member
    Join Date
    Sep 2001
    Location
    Orlando
    Posts
    392

    You seem very experienced with Database programming



    If you aren't using adodbconnection, what are you using then?

    You'll have to use sql to retrieve the records. Construct the sql command on the fly, based on the values entered.

    You got it.

    Abu Haider
    ____________________________
    100% Data Validation for the MS DataGrid Control. Plus Support for Custom and Foreign Lists, DatePicker and much more...
    The DataGridEnhancer


    I often point to a place where the problem has been discussed, instead of giving you the code that solves it. This is for good, may be you will understand some day...

  4. #4
    Addicted Member E-Link's Avatar
    Join Date
    Nov 2001
    Location
    INA
    Posts
    242
    where is ur attachment ?


  5. #5

    Thread Starter
    Addicted Member Lina229's Avatar
    Join Date
    Sep 2001
    Location
    Guess !!!
    Posts
    157
    i am using the datagrid ....
    but that is not what i want

    i want to (u can say filtering ) . as i had posted before ....

    if i entered a value in one of these textboxes ... and when i press Find Command Button .. i should retrieve the specified record


    take a look on my attachement below...i am using a datagrid to view my database .

    P.s. How i can use Data Control ?

    thnx
    Attached Files Attached Files
    Where Ignorance Is Bliss , It's Folly To Be Wise
    ---------------------------------------------
    -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.

    Best Regards;
    Lina

  6. #6
    Addicted Member E-Link's Avatar
    Join Date
    Nov 2001
    Location
    INA
    Posts
    242
    where did you bind ur datagrid , to adodc or data control ?

  7. #7

    Thread Starter
    Addicted Member Lina229's Avatar
    Join Date
    Sep 2001
    Location
    Guess !!!
    Posts
    157

    Re: You seem very experienced with Database programming

    Originally posted by Abu haider


    If you aren't using adodbconnection, what are you using then?

    You'll have to use sql to retrieve the records. Construct the sql command on the fly, based on the values entered.

    You got it.


    Yes of course i got it ....

    i have an access2000 database .... i am not using (adobconnection) i am not familiar with ADO Connection i am using DAO....
    Where Ignorance Is Bliss , It's Folly To Be Wise
    ---------------------------------------------
    -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.

    Best Regards;
    Lina

  8. #8

    Thread Starter
    Addicted Member Lina229's Avatar
    Join Date
    Sep 2001
    Location
    Guess !!!
    Posts
    157
    Originally posted by E-Link
    where did you bind ur datagrid , to adodc or data control ?
    to DataControl
    Where Ignorance Is Bliss , It's Folly To Be Wise
    ---------------------------------------------
    -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.

    Best Regards;
    Lina

  9. #9
    Addicted Member E-Link's Avatar
    Join Date
    Nov 2001
    Location
    INA
    Posts
    242
    so , what's the matter with my code , which i posted before ?

    if change the datasource of datacontrol , the datagrid will automatically change the contain.

  10. #10

    Thread Starter
    Addicted Member Lina229's Avatar
    Join Date
    Sep 2001
    Location
    Guess !!!
    Posts
    157
    so how i can set focus on the textbox i want to search by its value ?
    Where Ignorance Is Bliss , It's Folly To Be Wise
    ---------------------------------------------
    -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.

    Best Regards;
    Lina

  11. #11
    Hyperactive Member
    Join Date
    Sep 2001
    Location
    Orlando
    Posts
    392
    The greatest advice on Database programming:
    USE ADO INSTEAD OF DAO.

    DAO is worth forgetting.
    Abu Haider
    ____________________________
    100% Data Validation for the MS DataGrid Control. Plus Support for Custom and Foreign Lists, DatePicker and much more...
    The DataGridEnhancer


    I often point to a place where the problem has been discussed, instead of giving you the code that solves it. This is for good, may be you will understand some day...

  12. #12

    Thread Starter
    Addicted Member Lina229's Avatar
    Join Date
    Sep 2001
    Location
    Guess !!!
    Posts
    157
    Originally posted by Abu haider
    The greatest advice on Database programming:
    USE ADO INSTEAD OF DAO.

    DAO is worth forgetting.


    well.......
    i am intending to do so .... actually i am thinking to switch to the ADO thing ..

    Do u know some articles or some sites which can provide me with some information .....
    Where Ignorance Is Bliss , It's Folly To Be Wise
    ---------------------------------------------
    -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.

    Best Regards;
    Lina

Posting Permissions

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



Click Here to Expand Forum to Full Width