You need to use VBA code that rewrites the SQL of the query before you run
it:
Dim dbCurr As DAO.Database
Dim qdfCurr As DAO.QueryDef
Dim strSQL As String
Set dbCurr = CurrentDb()
Set qdfCurr = dbCurr.QueryDefs("MyPassthroughQuery")
strSQL = "EXEC Update_Allocation_Type @AllocationNM ='" &
Me.txtAllocation & "', @Parameter2=" & Me.txtValue
qdfCurr.SQL = strSQL
qdfCurr.Execute dbFailOnError
Alternatively,
Dim dbCurr As DAO.Database
Dim qdfCurr As DAO.QueryDef
Dim rsCurr As DAO.RecordSet
Dim strSQL As String
Set dbCurr = CurrentDb()
Set qdfCurr = dbCurr.QueryDefs("MyPassthroughQuery")
strSQL = "EXEC Update_Allocation_Type @AllocationNM ='" &
Me.txtAllocation & "', @Parameter2=" & Me.txtValue
qdfCurr.SQL = strSQL
Set rsCurr = qdfCurr.OpenRecordset
Note that this is DAO code. By default, Access XP doesn't have a reference
set to DAO. If you haven't already done so, you'll need to go to Tools |
References while you've got the VB Editor open, scroll down until you find
the Microsoft.DAO 3.6 Object Library and put a check mark beside it.