Partial display of fields in text box from a combo box in a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have a combo box on a form which is unbound. However it is drawing data from
a row source which is actually a joined sql statment. Now, there are few
other text boxes on the form which are unbound. However, on selecting one
particular row of the combo box, the data corresponding to that record should
display in the various text boxes.

The following is the code to fill up the text boxes on the form.
Private Sub cboSelectBlockGrant_AfterUpdate()

Me.Desc = Me.cboSelectBlockGrant.Column(2)
Me.FedNo = Me.cboSelectBlockGrant.Column(3)
Me.Year_mod = Me.cboSelectBlockGrant.Column(4)
Me.Code_mod = Me.cboSelectBlockGrant.Column(5)
Me.AwardAmount_mod = Me.cboSelectBlockGrant.Column(6)
Me.Refresh

End Sub

However, the form only displays the contents of column(2) and column(3)
of the row source of the combo box and not the contents of column(4),
column(5) and column(6). I have no idea of knowing why some of the text
boxes are not getting filled in.

Any help is highly appreciated.
 
However, the form only displays the contents of column(2) and column(3)
of the row source of the combo box and not the contents of column(4),
column(5) and column(6).

Possibly a silly question but... is the Column Count property of the
combo set to 7 or more? Column 4 (the fifth field in the query) and
above will not be available even if the field is included in the query
unless the ColumnCount property is large enough.
 
Back
Top