Hello folks;

I would like to know how I can insert the value of a field on my form in an SQL string.
For example:
There is a field on my form with the name txtKey; it contains a number.
I would like to make a query which uses the current number in that field to search in a database:
"SELECT Name, IDNumber FROM People
where IDNumber = txtKey"
This doesn't work, I know, but how can I do this?
How can I use the current value of a field in this Query?

Thanks in advance for any reply;
Carl