我认为您将必须动态构建查询。
sSQL="SELECt TOP " & DlookUp("ExamSize","tblExam","ExamID = 10") _ & " FROM tblExamQuestions INNER JOIN tblExam " _ & "ON tblExamQuestions.ExamID = tblExam.ExamID " _ & "WHERe tblExam.ExamID = 10 " _ & "ORDER BY Rnd(tblExamQuestions.ExamQuestionID)"'' Permanently change an existing queryCurrentDB.QueryDefs("MyReportQuery").SQL=sSQL


