Hi Geoff,
An advice never type recordset in your subject, mostly that are unanswered
questions here.
More because you use a dataset.
Try to set a dataview between it.
dv = new dataview(dsEstablishment1.establishments)
dv.sort = "Name" 'or whatever
cb.datasource = dv
Then it will me showup sorted.
Because this was your first problem I do not know if the next will stay?
Cor
> I have a Windows form with a number of Bound Controls. When I want to add
a new record I clear all the combo boxes and text boxes by setting the text
properties to "". To add a new record to the dataset I use:
>
> Dim drNew As System.Data.DataRow
> drNew = Me.DsEstablishMaint1.Establishments.NewRow
> With drNew
> .Item("Code") = txtEstCode.Text
> .Item("Name") = txtName.Text
> .Item("Street") = txtAddress1.Text
> e.t.c.
> End With
> DsEstablishMaint1.Establishments.AddEstablishmentsRow(drNew)
>
> The problem I have got is that I have a bound Combobox at the top of my
form to select a record based on name. After adding a new record the name
on the record I have just entered appears twice: once in the correct
alphabetical position and once at the end of the list. If I try and select
any name in the list my program crashes with "Duplicate values are not
allowed on name" which is my primary key. I have tried experimenting with
Currency Manager's AddNew() method but this created further problems. So is
there a way to prevent the duplicate values appearing in my combo box and
why should this happen anyway?
>
|