• Dlookup (2000)

    Author
    Topic
    #394671

    Hi, I have a combo box (query) that shows the names of the queries, the ID number is hidden. I have a text box (referrals) that needs to contain the query types selected from the combo, thus say query XXX is selected in the combo, XXX is shown in the text box then suppose query YYY is selected, YYY shows in the list box below XXX and so on. The problem I have is that my code on the after update event on the cmb box works but instead of XXX an YYY showing in the text box, 1 and 2 show i.e. the IDs for XXX and YYY are displayed. I believe I can remedy this with dlookup but I am not confident in using. The code on the event is currently:

    Private Sub cmb_AfterUpdate()

    text = (text + vbCrLf) & cmb

    End Sub

    Thank U Darren.

    Viewing 1 reply thread
    Author
    Replies
    • #725407

      You can refer to a specific column of a combo box. You want to refer to the second column (the first is the hidden ID column). The column index starts at 0, so the second column has index 1. Try

      text = (text + vbCrLf) & cmb.Column(1)

    • #725408

      You can refer to a specific column of a combo box. You want to refer to the second column (the first is the hidden ID column). The column index starts at 0, so the second column has index 1. Try

      text = (text + vbCrLf) & cmb.Column(1)

    Viewing 1 reply thread
    Reply To: Dlookup (2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: