Results 1 to 6 of 6
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Looking For Correct Syntax? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    I have a button that updates records on the screen with query name qry_Update_Claim_Pull_Code and it works OK

    I am now trying to implement the query in code and getting:

    Getting

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Looking For Correct Syntax? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    I would suspect it's choking on the form reference. Try concatenating the form reference so that the value is passed in instead of the full reference. The "too few parameters" error often shows up when you try to execute a query in code that needs a piece of information it can't resolve from the SQL.
    Charlotte

  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Looking For Correct Syntax? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    Hi Charlotte

    I didn't have any luck referencing the form in the code, however the following works.

    How would I change the following to reference the form anme as suggested?

    Thanks for your help

    John

    qd.sql = "UPDATE tblArrivals SET tblArrivals.intStatus = 16, " _
    & "tblArrivals.dteDatePulled = Date() " _
    & "WHERE (((tblArrivals.intStatus) = 1) " _
    & "AND ((tblArrivals.strMemberName) ='" & Me![ComboMemberClaimsGreaterTwo] & "'));"

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Looking For Correct Syntax? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    Can you explain this again? What is anme? (I'm sure it's me, after all English is not my native language)

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Looking For Correct Syntax? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    Try this, assuming you aren't running it from frm_Arrivals (otherwise, what's wrong with using the version that works?):

    <pre>"UPDATE tblArrivals SET tblArrivals.intStatus = 16, " _
    & "tblArrivals.dteDatePulled = Date() " _
    & "WHERE (((tblArrivals.intStatus)=1) " _
    & "AND ((tblArrivals.strMemberName)='" _
    & [Forms]![frm_Arrivals]![ComboMemberClaimsGreaterTwo] & "'));"</pre>

    Charlotte

  6. #6
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Looking For Correct Syntax? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    Hi Charlotte

    Thanks

Posting Permissions

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