Home Forums Microsoft Access Microsoft Access Access 2003 adp: Run-time error ''91'': Object variable or with block variable not set RE: Access 2003 adp: Run-time error ''''91'''': Object variable or with block variable not set

  • Scott,

    What Cory added to your stored procedure was the @year input parameter.  This input paramter is needed as part of the stored procedure if you are wanting to pass the year (1995) to the SP.  That is what your VB code is doing in the following lines:

    ' ---Create parameter, assign value, and append to command

    Set prm3 = cmd1.CreateParameter("year", adChar, _

        adParaInput, 4)

    prm3.Value = "1995"

    cmd1.Parameters.Append prm3

    You cannot pass an input parameter to a SP unless the SP is expecting one.