MoveFirst, MoveLast

G

garethg

The code below is a sample of code that I use to try and set the values
for two drop down lists.
The table that it points to is a linked FoxPro database. I think that
the table has some form of indexing that I cannot see in the records
which means that it does point to the first and last items, however I
sorted by list alphabetically by 'SN_ACCOUNT' so that the first records
would be AAA001
and the last ZZZ999
but it does not seem to work?
Any suggestions how I might get it to look at the last alphabetical
item and the first alphabetical item.

Set rst = dbs.OpenRecordset("Sname")
rst.MoveLast
comboLastAcc.Value = rst!SN_ACCOUNT
rst.MoveFirst
comboFirstAcc.Value = rst!SN_ACCOUNT
rst.Clos

Thanks
GarethG
 
S

Steve Schapel

Gareth,

I have no idea whether you can do this with linked FoxPro files, so
this is a "try it, just in case" suggestion...
Set rst = dbs.OpenRecordset("SELECT * FROM Sname ORDER BY SN_ACCOUNT")

- Steve Schapel, Microsoft Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top