Results 1 to 4 of 4

Thread: access 2007 & VB6 "Too few parameters. Expected 1." when using a variable

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2009
    Location
    B.C. Canada
    Posts
    206

    access 2007 & VB6 "Too few parameters. Expected 1." when using a variable

    StoreSelected and TheSku are both variables. when i replace TheSku with 6070014 this works fine but when using the variable TheSku i get error message "Too few parameters. Expected 1."

    TheSku is decaled as long and is a long number in access

    thanks in advance for any help.

    Code:
    "select * from storeskus where storename = '" & StoreSelected & "' and ourstocknumber = TheSku "

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Dec 2009
    Location
    B.C. Canada
    Posts
    206

    Re: access 2007 & VB6 "Too few parameters. Expected 1." when using a variable

    this seems to work:
    Code:
    "select * from storeskus where storename = '" & StoreSelected & "' and ourstocknumber = " & TheSku & " ",

  3. #3
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: access 2007 & VB6 "Too few parameters. Expected 1." when using a variable

    Code:
    "select * from storeskus where storename = '" & StoreSelected & "' and ourstocknumber = " & TheSku  & ""
    edit: hmm, I typed slow!

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Dec 2009
    Location
    B.C. Canada
    Posts
    206

    Re: access 2007 & VB6 "Too few parameters. Expected 1." when using a variable

    many thanks for your reply, Si.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width