denright
Programmer
- Oct 19, 2001
- 7
- 0
- 0
I have a form that is bound to a table called ContactHistory. For new records, I would like to populate a text box (txtPersonID) on the form using a query that takes data from another table (Person).
I tried this:
sqlPersonID = "SELECT DISTINCTROW PERSON.PersonID " & _
"FROM PERSON " & _
"WHERE PERSON.First & "" "" & PERSON.Last = cboClientName.Value;"
txtPersonID = sqlPersonID
The query itself works but I can't populate the textbox because txtPersonID is a long and sqlPersonID is a string.
How can I get the value of that query into the text box?
I tried this:
sqlPersonID = "SELECT DISTINCTROW PERSON.PersonID " & _
"FROM PERSON " & _
"WHERE PERSON.First & "" "" & PERSON.Last = cboClientName.Value;"
txtPersonID = sqlPersonID
The query itself works but I can't populate the textbox because txtPersonID is a long and sqlPersonID is a string.
How can I get the value of that query into the text box?