Problem in VB SQL Query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MeeMee
    New Member
    • Jan 2008
    • 35

    #31
    Still getting a run-time error '-2147217900 (80040e14): Syntax error in Insert Into Statement.

    Comment

    • QVeen72
      Recognized Expert Top Contributor
      • Oct 2006
      • 1445

      #32
      Hi,

      If both tables have same Structure , try this :


      sSQL = " Insert Into TRequests " _
      & " Select * From Requests " _
      & " Where ReqType = '" & rtype & "'" _
      & " And ReqSubType = '" & ReqTypeCmb.Text & "'" _
      & " And Directorate = 'Direc1' "

      Check all the tablename and field names are spelled properly..

      Regards
      Veena

      Comment

      • MeeMee
        New Member
        • Jan 2008
        • 35

        #33
        Originally posted by QVeen72
        Hi,

        If both tables have same Structure , try this :


        sSQL = " Insert Into TRequests " _
        & " Select * From Requests " _
        & " Where ReqType = '" & rtype & "'" _
        & " And ReqSubType = '" & ReqTypeCmb.Text & "'" _
        & " And Directorate = 'Direc1' "

        Check all the tablename and field names are spelled properly..

        Regards
        Veena
        Tried it and it worked , it now shows all retrieved records even if it was one.

        Thanks again :)

        Hopefully this will be the last problem

        Comment

        Working...