Dynamic number in a TOP clause

cmac2210

Registered User.
Local time
Yesterday, 22:08
Joined
Mar 26, 2009
Messages
12
Is it possible to pass a number from a textbox into a TOP clause query?
 
Sure.
If you are using vba you could change this:
"SELECT TOP 10 TABLE1.* INTO 1SAMPLE FROM TABLE1 ORDER BY TABLE1.ZIP;"


To this:
"SELECT TOP " & VariableHere & " TABLE1.* INTO 1SAMPLE FROM TABLE1 ORDER BY TABLE1.ZIP;"

"VariableHere" would be your dynamic number from your textbox.
 

Users who are viewing this thread

Back
Top Bottom