I am trying to learn how to build custom reports for people in the office. Thus far i have had no problems creating the Form, stored procedure and the report. But where i am stumped is how to send the Form Data/variables through to the Stored procedure.
For instance i have a combo box that allows for the selection of customer Ids, but when i place a valid customer Id in the field and run the report i get a popup that i think is from the stored procedure asking me for custId (which is a variable in the stored procedure)
So i guess what i need to know is how to take the value from the combo box and send it to the stored procedure as the custId variable.
The stored procedure is in SQL, i've basically been looking at all of the other forms in the project and trying to learn on the fly. My form works the stored procedure works independantly as well, i feel that i may be missing something simple.
Here is a sample Sub within VBA that builds the Exec string for the pass-through query that I want run. This one happens to be a stored procedure that will update the Job record in the tblJob table with the billing amount that should have happened so far on the job. Here is the Sub:
Sub CalcBillingAmount(JobID As Long)
Set qdef = CurrentDb.QueryDefs("spUpdateBillingAmount")
qdef.sql = "Exec spUpdateBillingAmount @BillingAmount = " & _
GetBillingAmount(JobID) & ", @JobID=" & JobID
On Error GoTo 0
Set qdef = Nothing
Then the SQL for the pass-through query ends up looking like this: