MoveFirst, MoveLast

  • Thread starter Thread starter garethg
  • Start date Start date
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
 
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

Similar Threads

Run Query on Subform Using VBA Macro Button 1
Do/Loop Dilemma 6
How to use Seek vs FindFirst 5
set recordset to first record 1
Function not working 3
findfirst problem 11
Find code errors 1
Do I need a Nested Loop? 14

Back
Top