RE: Error in passing in parameter

  • Hi everyone,

    I'm trying to pass in a parameter to stored procedure in a form

    and is giving me the following error:

    MSAccess

    There was a problem accessing a propery or method of the OLE object.

    works

     Me!shipping_sched_list_subform.Form.RecordSource = "exec spShipping_sched_daterange"

    Doesn’t work

    Dim num_days as integer

    Num_days = 14

       Me!shipping_sched_list_subform.Form.RecordSource = "exec spShipping_sched_daterange '" & num_days & "'" "

    Can anyone know how I can fix this?

    Thanks much!

  • What is the data type of the stored procedure's parameter?

    If it's int, try this:

    ... = "exec spShipping_sched_daterange " & num_days

    If it's char or varchar, try:

    ... = "exec spShipping_sched_daterange '" & num_days & "'"

     

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply