list box, id fields

T

Tammy

I have a list box bound to an id field. I need to access
the name of the referenced item versus the id... here is
what I currently have as code. I am getting an error for
type mismatch. I did have the bound column to the name
field and this worked fine (well, without a line or two,
I have tried to adapt it now that I have changed to the
id); I need to id for another procedure (if the item is
double clicked, I need to have the id; but if selected
and then another button is pushed, I need the name). Any
suggestions?? Here is the code:

*intID is defined as an integer and SOPid is an
autonumber field

For Each varSelItem In ctlList.ItemsSelected
intID = ctlList.ItemData(varSelItem)
varItem = DLookup("[SOP Name]", "tblMain", "[SOPid]
= """ & intID & """")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top