a) you can't use the same prm variable for 2 different values like that, especially on one line. If you simply split the line, prm will get one value from one line, then another.
b) that means a loop isn't much good
c) not sure if you can Eval a parameter prompt
The dates should come from form controls and be validated to ensure dates are supplied. Then you can ditch Eval and the parameters if you refer to the form controls in the query. Concatenation of sql in code can also eliminate the parameter problem provided you use concatenation on the form control parts.
Setting the parameters in the query itself is another way.
Alternatively, ditch the loop and provide the parameter names and their values:
Code:
qdf.Parameters("JobID") = lngJobID
qdf.Parameters("WorkMnth") = intMonth
qdf.Parameters("WorkYear") = intYear
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.