is there a way to get this docmd.outputto command to pass the parameters through code, instead of having to type them in? My end users are not that SQL savvy. I would rather pass the stored procedure parameters that they have already entered into text boxes on the access form.
Using References to User Entered Data
Collapse
X
-
Tags: None
-
Any parameter that is passed a string (text within the " characters) in ADezii's code can also be passed anything that refers to a string variable. Try replacing the string parameter you want the user to enter with a reference to the control on your form (See Referring to Items on a Sub-Form).
Welcome to Bytes!
PS. This thread was split off from http://bytes.com/topic/access/answer...rocedure-excel -
I understand how to reference the textbox values.
I just couldn't figure out how to put the parameters into the procedure call for the excel export.
However, I just tested it by adding the sql EXEC command before the stored procedure name:
now it works. Thanks.Code:docmd.OutputTo acOutputStoredProcedure,"exec sps_LoadBuilder '" & me.txtStartDate.value & "','" & me.txtEndDate.value & "'," & me.txtViewValue.value,acformatxls
Comment
-
I can't see that the "Exec" would be necessary, but your before and after images are not of the same thing so I can't do a matching alternative for you to try.
I expect you're not fussed about such details anyway, and you have a working solution, so good for you and I won't worry about digging in further unless you decide you're interested in the finer details.Comment
Comment