K
Keith G Hicks
I need to populate the source of a list box from an ado recordset
Dim rec As ADODB.Recordset
Set rec = New ADODB.Recordset
rec.Fields.Append "AttyID", adBigInt
rec.Fields.Append "AttyName", adVarChar, 100
rec.Open
Then I get the value from a combo box and do the following:
rec.AddNew
rec!AttyID = Me.cboAttorneys.Column(0)
rec!AttyName = Me.cboAttorneys.Column(1)
rec.Update
rec.Sort = "AttyName"
Finally I need to set the source of the list box to the rec somehow but
that's where I get stuck.
Me.lstAttorneys.RowSource = rec.?????
I have to use Table/View/StoredProc and not ValueList as the RowSourceType
because the number of rows is so that the list exceeds 2048 characters.
How can I solve this? It's an adp so there are no local tables otherwise I'd
just us a local permanent temp table.
Thanks,
Keith
Dim rec As ADODB.Recordset
Set rec = New ADODB.Recordset
rec.Fields.Append "AttyID", adBigInt
rec.Fields.Append "AttyName", adVarChar, 100
rec.Open
Then I get the value from a combo box and do the following:
rec.AddNew
rec!AttyID = Me.cboAttorneys.Column(0)
rec!AttyName = Me.cboAttorneys.Column(1)
rec.Update
rec.Sort = "AttyName"
Finally I need to set the source of the list box to the rec somehow but
that's where I get stuck.
Me.lstAttorneys.RowSource = rec.?????
I have to use Table/View/StoredProc and not ValueList as the RowSourceType
because the number of rows is so that the list exceeds 2048 characters.
How can I solve this? It's an adp so there are no local tables otherwise I'd
just us a local permanent temp table.
Thanks,
Keith