Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2006

    Unanswered: combo box displaying corresponding value into textboxes issues

    Hi community experts,

    I am encountering a problem to display the corresponding values of the combo box into the textboxes. I have chose option 1 & 3 for this implementation but neither is working. My combo box only contains distinct values, once i select the values frm that combo box, the corresponding matching the values from the combo box from the table will be displayed in the textboxes. It wont make much sense if I bound the textboxes to the controlSources. When I load the form i only can make selection from my combo box and the corresponding value is nt display on my textboxes at all. Tks

  2. #2
    Join Date
    Dec 2002
    Préverenges, Switzerland
    let me try to rephrase: you have a multi-column combo - when an item is selected in the combo, you want to display the various columns in textboxes.

    assuming that is what you want to do, first thing to note is that the columns in a combo use a zero-based index (0,1,2, etc for the first, second, third field in your SELECT that feeds the combo = first, second, third column in the combo).

    from there it is easy:

    private sub mycombo_afterupdate()
    me.Field3Textbox = me.mycombo.column(2)
    me.Field9Textbox = me.mycombo.column(8)

    you might want to set a default combo value in form_load.
    for example the first entry:
    me.mycombo = me.mycombo.column(N,0) 'N is zero-based index of boundcolumn

    you might want to clear your combo:
    me.mycombo = null

    or check that there is something selected in the combo:
    if me.mycombo = null then

    currently using SS 2008R2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts