Going quietly mad!!!!!!

J

JulieD

Okay, i'm stumped

i'm running the following code from a module (Access 97) - section1 works
find and retrieves 13 records
Section 2 SHOULD retrieve 8 records but it only retrieves one

Can't figure this out and i need to URGENTLY - all help gratefully received
*****
Code
Dim dbs as DAO.Database
Dim rst as DAO.Recordset
Dim strsql as String
Dim numrecs as integer

Section 1
set dbs = currentdb
strsql = "SELECT sysTBL_DataTables.Order,
sysTBL_DataTables.TableName " _
& "FROM sysTBL_DataTables ORDER BY sysTBL_DataTables.Order"
Set rst = dbs.OpenRecordset(strsql)
numrecs = rst.recordcount 'returns 13 which is correct
~other code~
rst.close
rst = nothing

Section 2
strsql = "SELECT ztbl_Jurisdiction.Jurisdiction FROM
ztbl_Jurisdiction ORDER BY Jurisdiction"
set rst = dbs.OpenRecordset(strsql)
numrecs = rst.recordcount 'returns 1 should be 8

*** end code

Section 2 is returning the first record in the table, and if i order it
descending it returns the last one - but for some reason it is not returning
ALL the records

any ideas????

Regards
JulieD
 
J

JulieD

okay guys ... i did a google search and found the answer!
(need to use rst.movefirst & rst.movelast to force it to behave - had tried
both separately but not together)

cheers
JulieD
 

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