VBA Create Table Statement - Syntax Error - Need Fresh Eyes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dowlingm815
    New Member
    • Feb 2010
    • 133

    VBA Create Table Statement - Syntax Error - Need Fresh Eyes

    Hi,

    I need fresh eyes to see where my syntax error is occurring.

    Any assistance would be appreciate.


    Mary
    Code:
    CurrentDb.Execute ("CREATE TABLE tbl_FYData(PIDM Integer, " & _
                                            "FY Varchar(2), " & _
                                            "[PO Trans Date] DATETIME, " & _
                                            "PO VARCHAR(8), " & _
                                            "Index Varchar(6), " & _
                                            "IndexApprAmt Varchar(4), " & _
                                            "Item Integer, " & _
                                            "NIGPCommCode Varchar(8), " & _
                                            "NIGPDesc Varchar(150), " & _
                                            "Unit Integer, " & _
                                            "Qty Integer, " & _
                                            "Total Integer,  " & _
                                            "Buyer VARCHAR(4), " & _
                                            "ShipCode VARCHAR(4), " & _
                                            "Orgn VARCHAR(6), " & _
                                            "Account Varchar(6), " & _
                                            "[PO Amt] Integer, " & _
                                            "[V Type Code] VARCHAR(2),  " & _
                                            "[Last Name] VARCHAR(50), " & _
                                            "[First Name] VARCHAR(50), " & _
                                            "City VARCHAR(50), " & _
                                            "State VARCHAR(50), " & _
                                            "[Zip Code] VARCHAR(10), " & _
                                            "[Entity Ind] VARCHAR(1))")
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Index is a reserved keyword in SQL.

    Comment

    • dowlingm815
      New Member
      • Feb 2010
      • 133

      #3
      Thank you, totally ignored that situation, which in past, I was well aware of that error.

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32656

        #4
        Mary, while you're here, check out Debug SQL String.

        Comment

        Working...