Results 1 to 4 of 4

Thread: Syntax error VB6 & Jet4 Database

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2004
    Posts
    26

    Thumbs up Syntax error VB6 & Jet4 Database

    Hi,
    This is my first time at VB Forums.
    I think this is the correct area for posting coding questions.
    If it is not, please let me know.

    Question:
    I have been building a VB6 application with Jet 4 Microsoft Data Base for tracking investments.
    Since I am relatively new to VB I continue to have difficulty with the syntax.

    The following code generates a syntax error when I run the application.

    adoTrackInvest.RecordSource = "SELECT Invested FROM History WHERE Date >= # " & txtTrackingDate & " # AND Investor_Number = " & frmStartPage.txtInvestorNumber & " AND Value = " & txtHiVal & "'"
    adoTrackInvest.Refresh

    What is puzzeling to me is that the Error Message Box that warns of the syntax error seems to be able to draw the required info from the text boxes.

    The message I get is:
    Syntax error in query expression 'Date>= #4/3/2004# AND Investor_Number = 5 AND Value = $29,697.00".

    All these values are correct.

    Any help on this will be greatly appreciated.
    Thanks,
    Dwight


    This has been resolved.
    Many thanks to ae_jester

    I formatted the text to numeric with no commas and attached the ado to a variable then re formatted for currency.
    Works great.
    Many thankful regards,
    Dwight
    Last edited by DK47; Apr 13th, 2004 at 06:13 PM.

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