Quote:
> =
> I=B4ve successfully been able to produce a database with this code:
> =
> datDisk.DatabaseName =3D "c:\program\Micros~2\samples\Diskonto.MDB"
> =
> datDisk.RecordSource =3D "R=E4nta"
> datDisk.Refresh
> =
> datDisk.Recordset.AddNew
> =
> datDisk.Recordset("=C5r") =3D txt=C5r.Text
> datDisk.Recordset("M=E5nad") =3D TxtFM=E5n.Text
> datDisk.Recordset("Dag") =3D Txtdag.Text
> datDisk.Recordset("Diskonto") =3D TxtDisk.Text
> =
> BUT I=B4d like to have it sorted. The db consists of dates and
> interestrates and I want to use it for calculation and want to have
> the rows in dateorder. I tried several ways of sorting, but with no
> success. I=B4d appreciate any help.
Mats,
Instead of setting the RecordSource property of your data control to a
table (Ranta),
try setting to a valid SELECT statement with an ORDER BY clause:
datDisk.RecordSource =3D "Select [field1], [field2], ... from Ranta ORDE=
R
BY [datefield]"
However, every time you add a new record you will need to REFRESH the
data control in order to keep the data control's recordset in the
correct order.
HTH...
Tom