I have several queries in an MS Access database. Some of these use parameters. I use the following code in VBA to provide the query with these parameters:
VB
The reply from Albert Kallal was spot on. Thanks Albert. I tried to comment after signing up but... did not have enough points to comment so... Hoping this goes through....
The only thing I changed was....
I replaced the Set rst = .OpenRecordset
with...CurrentDb.QueryDefs("q_PTO_SubmitNewRequest").Execute
Thanks again for posting this. It really was a HUGE help. I had many complex .adp projects years ago and am working with a client needing similar functionality. It looks like I can mirror the .adp functionality using the pass through queries. Very Cool :)
With CurrentDb.QueryDefs("q_PTO_SubmitNewRequest")
.SQL = strSQL
End With
CurrentDb.QueryDefs("q_PTO_SubmitNewRequest").Execute