If the record source of your form is the table directly,
you could try
Me.Recordsource="Select TOP 20 From table"
Me.Requery
You can extend this by having a combo box with values 10, 20, ...
and then
Me.Recordsource="Select TOP " & combo & " From table"
Me.Requery
If the recordsource is a Query, then you could use, that the query must start with "Select" (6 chars).
Then you could define a QueryDef variable, set it to your query and alter the query like this:
Dim qdf as Querydef
...
qdf.SQL="SELECT TOP " & combo & Mid(qdf.SQL,7)
...
Hope this helps,
MakeItSo
Andreas Galambos
EDP / Technical Support Specialist
(andreas.galambos@bowneglobal.de)
HP:
I would run it in a qury and then run reports of the query
if possible, i would like to have the opportunity to enter a number and it gives me the top #, according to the number. it would basically look at a number field which would have been calculated previously.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.