I am having problems getting a value from a combo box which is populated by a query.
Row Source for the combo box:
"SELECT rparts.Description, rparts.ID FROM rparts; "
Where rparts is a query and Description and ID are fields in the query.
In the code I do the following:
Dim rst As Recordset
Set rst = comLocation.Recordset
Get_comLocation = CLng(rst!ID)
Where comLocation is the combo box.
Get_comLocation is the function name - it returns the ID. What I'm trying to do is retrieve the ID associated with the description selected in the combo box. I think my problem has to do with a null value in the combo box, but when I try to retrieve that value I get errors about not being able to do that with query type row sources (it asks for value types).