Reputation: 3
In Acess how i can select a number of rows in a table from some number count that a user specifies.
For example, this DB is prompting to a user introduces a given number, p.e: 10, and the table retrives 10 records, given a table from 100 or 10000 records
Upvotes: 0
Views: 35
Reputation: 55831
Use dynamic SQL:
Dim rs As DAO.Recordset
Dim Top As Integer
Top = 10 ' User input.
Set rs = CurrentDb.OpenRecordset("Select Top " & Str(Top) & " * From YourTable")
Upvotes: 1