List Box

P

Pass-the-reality

I have a list box labeled CallReasonCategoryID. The list box is tied to a
table - CallCategory. What code would I need to add on the DoubleClick
function that would display a message of the selected CallCategory
definition. Example, if you double click on Support, a msg would display the
definition for Support.
 
A

Adam Milligan

This is air code, but here goes..

dim rec as recordset
dim iID as integer

iID = me.[your list box]

set rec = currentdb.openrecordset ("SELECT * FROM CallCategory where
CallReasonCategoryID =" & iID)

if not rec.eof then
msgbox rec("DefinitionForSupportField")
end if

of course, there is error checking and such to be added, but that might get
you started. Let me know if it gives you any problems.

Adam
 
K

KARL DEWEY

An easier way is to add the message of the selected CallCategory definition
in your CallCategory table and display when scrolling to select in a combo.
Set the list width to show the field but set the display box to the width of
the one field.
 

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