I have a database with several tables, one of which is [Master Data
Table]
I use this to bring up a form so you can unlock the record (set by
using a yes no box on the data input form to prevent unauthorised
tweaking once the record is completed).
I would like to move to the last record but 10 to give the form 10
lines of the last entries, rather than one that is achieved by using
goto record.... acLast
I have tried using sql in the form open event such that I can obtain
the total number of records, take away 10 and then use the offset
parameter to move to the required records. But I cannot either get
the syntax rightusing it as a straight expression in the On Open event
of the record unlock form, as in:
Dim numofrecords as Long
numofrecords = (SELECT COUNT(*) FROM [Master Data Table])
or alternatively by using a subquery as an expression in the original
query that underlies the record unlock form. It is probably just a
syntax problem, but I cant find a good resource to give examples of
this usage. I can see using SQL being quite useful to filter and
obtain relevant data for forms requiring statistical inquiry, but am
jiggered if I know how at this time
Any help gratefully appreciated.
JBN