PDA

Click to See Complete Forum and Search --> : search data


Peter van Collenburg
Dec 31st, 1999, 06:18 PM
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
peter@plamirel.nl

Peter van Collenburg
Jan 2nd, 2000, 07:51 AM
Is my question so difficult or was my explanation not correct?

MartinLiss
Jan 2nd, 2000, 09:07 AM
I haven't tested this, but it should work.

Dim ssMySnapshot As Snapshot

Set ssMySnapshot = DB.CreateSnapshot("Select * From Mytable where MyKey = '" _
& Text1.Text & "'")

Text2.Text = ssMySnapshot.datafield1
Text3.Text = ssMySnapshot.datafield2

------------------
Marty

Peter van Collenburg
Jan 2nd, 2000, 04:36 PM
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

Clunietp
Jan 3rd, 2000, 12:18 AM
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.... :)