Hi everybody
I'm newbie in access and I wanna know how we can use a Parameter in Select statement (SQL view)?
( actually I want to get a number from user and use it for selecting some random records)
tanks in advance
Hi everybody
I'm newbie in access and I wanna know how we can use a Parameter in Select statement (SQL view)?
( actually I want to get a number from user and use it for selecting some random records)
tanks in advance
Does this help http://office.microsoft.com/en-us/ac...001117077.aspx
SELECT * FROM tablename WHERE fieldname = [enter number];
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Thank june7 for your reply
I use parameter number in this code :
Code:SELECT TOP 5 * FROM [QuestionTable] ORDER BY rnd(INT(NOW*primarykey)-NOW*primarykey)
Instead of number 5 I want to get a number from a user.
what should I do?
I just tried to build query with a pop up parameter prompt for the number and it doesn't work.
Why do you need to have this number dynamic?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
As I told you. I'm beginner in access and don't like to use VB code.
I'm considering to build a Database for pulling some questions out from a question repository, base on chapter of course.
so I should get a number from user who want to prepare an exam and tell how many percentage of this exam must from which chapter.
e.g: an exam with 20 questions that 80% of those question must from Chapter one and 20% Chapter two.
Apparently cannot be dynamic in an Access query object. That means using code (VBA certainly, doubt macro can do this) to construct an SQL statement and setting the RecordSource property of form or report or the definition of a query with QueryDefs collection.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Thank you for your Help