I have the query:
which correctly select my random sample of 10percent of the required dataset.
However what I am wanting to do is replace 10 with a variable from a form.
Have tried the following & '([Forms]![frm_InspectionAudit]![Percentage])' & in place of the 10 but receive and error.
Is there anyway anyone knows of where a variable can be set inside a select query?
Code:
SELECT TOP 10 PERCENT Rnd(tbl_InspectionAudit1_1.COMPKEY) AS Expr1, Now() AS Expr2, fOSUserName() AS Expr3, tbl_InspectionAudit1_1.COMPKEY, tbl_InspectionAudit1_1.COMPBY, tbl_InspectionAudit1_1.AGENT, tbl_InspectionAudit1_1.REGIME, tbl_InspectionAudit1_1.INITIATION, tbl_InspectionAudit1_1.UNITID, tbl_InspectionAudit1_1.ACTCODE, tbl_InspectionAudit1_1.ACTDESC, tbl_InspectionAudit1_1.ACTKEY, tbl_InspectionAudit1_1.FirstOfSTARTDTTM, tbl_InspectionAudit1_1.TOWN, tbl_InspectionAudit1_1.ROADNAME, tbl_InspectionAudit1_1.DISTRICT, tbl_InspectionAudit1_1.OWNER, tbl_InspectionAudit1_1.DESCRIPT INTO tbl_InspectionAudit1_2
FROM tbl_InspectionAudit1_1
ORDER BY Rnd(tbl_InspectionAudit1_1.COMPKEY);
which correctly select my random sample of 10percent of the required dataset.
However what I am wanting to do is replace 10 with a variable from a form.
Have tried the following & '([Forms]![frm_InspectionAudit]![Percentage])' & in place of the 10 but receive and error.
Is there anyway anyone knows of where a variable can be set inside a select query?