Results 1 to 2 of 2

Thread: Too few parameters. Expected 2. ERROR

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2000
    Location
    bebenia, PA, USA
    Posts
    241
    I receive the error: Too few parameters. Expected 2. when I run the below code. I have never written a parameter in VB can someone help me out with what is wrong with the below code?

    Data1.RecordSource = "PARAMETERS [FROM DATE] DateTime [TO DATE] DateTime;"
    Data1.RecordSource = "SELECT * from MASTER where DATE_OPENED between [FROM DATE] AND [TO DATE]"

  2. #2
    Hyperactive Member
    Join Date
    Feb 2000
    Posts
    284
    I've never used code like that but it seems to me that you might simply be missing a comma after the first "DateTime".
    I have put it in below-

    Data1.RecordSource = "PARAMETERS [FROM DATE] DateTime, [TO DATE] DateTime;"

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