Results 1 to 5 of 5

Thread: search data

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 1999
    Location
    Tiel, Gld, Netherlands
    Posts
    11

    Post

    I've craeted a form on which I've 3 fields. In the first field I want to type data, I've used the Keypress function to format my string e.g. "4" becomes "000004", when I type "1" my string becomes "000041". That also what I wanted.
    What I'm looking for a function or a piece of code in which I can directly search my database for the excistence of the typed key and if found display 2 fields from this database in the field 2 and 3

    If you like I can e-mail you a part the code I've created up until now.

    Regards, Peter
    [email protected]

  2. #2

    Thread Starter
    New Member
    Join Date
    Dec 1999
    Location
    Tiel, Gld, Netherlands
    Posts
    11

    Post

    Is my question so difficult or was my explanation not correct?

  3. #3
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Post

    I haven't tested this, but it should work.

    Code:
    Dim ssMySnapshot As Snapshot
    
        Set ssMySnapshot = DB.CreateSnapshot("Select * From Mytable where MyKey =    '" _
            & Text1.Text & "'")
    
        Text2.Text = ssMySnapshot.datafield1
        Text3.Text = ssMySnapshot.datafield2
    ------------------
    Marty

  4. #4

    Thread Starter
    New Member
    Join Date
    Dec 1999
    Location
    Tiel, Gld, Netherlands
    Posts
    11

    Post

    Hello Marty,

    To begin all the best for 2000.
    Thanks for your reply(s).

    The sample you sended is for 'old' ADO's said VB6.
    But you helped me with this anyway. I've found another example in MSDN via the help topic on this 'old' ADO.

    Regards, Peter

  5. #5
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    PETER:

    You should tell us in the future if you are using ADO or DAO, for some reason we have a hard time reading minds....

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