set parameter as user input

sam*

New member
Local time
Today, 11:53
Joined
May 11, 2005
Messages
9
Hi everyone
Is there a way through vba we can set the parameter
so say i have table of 1000 records
how would i get to pull 100 records or 50 records or 10 records
i want a parameter box to come and ask me how may records i want to pull out!!!
 
What do you want to do with the set of records?

Do you want to display or process etc....
 
NumRecordsRequired = Forms![Formname]![Fieldname]

strSQL = "select TOP " & NumRecordsRequired & " FROM TABLE;"

DoCmd.RunSQL (strSQL)
 
Sorry... missed the asterix

strSQL = "select TOP " & NumRecordsRequired & " * FROM TABLE;"
 

Users who are viewing this thread

Back
Top Bottom