• Carrying forward a SQL command in the Window

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Carrying forward a SQL command in the Window

    Author
    Topic
    #465258

    Hi apologies for a super easy query here – I’ve tried searching for an answer but probably am not putting it correctly. I have a query which I’m pasting into an on click event, but its too long for the window – I remember that there is a very simple mechanism for carrying it forward, but I just can’t remember! (too much brandy over Xmas…..) here’s what I mean – I think its something like “& _ but I cant get it to work…. so the line breaks at the point of the ‘ ” ‘

    DoCmd.RunSQL “INSERT INTO SubProcesses ( [Process Name], [Process Description], [Process BAU or Project?], [Sub-Process Name], [Sub-Process Description], [Sub-Process BAU or Project?], [Process % Complete], [Process Actual Start Date], [Process Actual Completion Date], [Sub-Process Flowcharts/ Narratives Complete & Attached?], Status, [Sub-Process Baselined Start Date], [Sub-Process Baselined Completion Date], [Sub-Process Revised Start Date], [Sub-Process Revised Completion Date] ) ”

    SELECT SubProcessesIn.[Process Name], SubProcessesIn.[Process Description], SubProcessesIn.[Process BAU or Project?], SubProcessesIn.[Sub-Process Name], SubProcessesIn.[Sub-Process Description], SubProcessesIn.[Sub-Process BAU or Project?], SubProcessesIn.[Process % Complete], SubProcessesIn.[Process Actual Start Date], SubProcessesIn.[Process Actual Completion Date], SubProcessesIn.[Sub-Process Flowcharts/ Narratives Complete & Attached?], SubProcessesIn.[Sub-Process Documentation Status], SubProcessesIn.[Sub-Process Baselined Start Date], SubProcessesIn.[Sub-Process Baselined Completion Date], SubProcessesIn.[Sub-Process Revised Start Date], SubProcessesIn.[Sub-Process Revised Completion Date] FROM SubProcessesIn;

    Thanks for your help!

    Viewing 2 reply threads
    Author
    Replies
    • #1194597

      Is this what you needed:

      & vbCrLf & _

      Used like the following example:

      strMsgPrompt = “Confirm Selection” & vbCrLf & _
      “Selecting This Option Will Over-Write” & vbCrLf & _

    • #1194604

      Try this (or something like it)

      Code:
      strsql = "INSERT INTO SubProcesses ( [Process Name], [Process Description], [Process BAU or Project?], [Sub-Process Name], [Sub-Process Description]," _
      & " [Sub-Process BAU or Project?], [Process % Complete], [Process Actual Start Date], [Process Actual Completion Date]," _
      & " [Sub-Process Flowcharts/ Narratives Complete & Attached?], Status, [Sub-Process Baselined Start Date], [Sub-Process Baselined Completion Date]," _
      & " [Sub-Process Revised Start Date], [Sub-Process Revised Completion Date] ) "
      

      docmd.runsql strsql

    • #1194606

      Thanks folks, I eventually remembered that I used to use ” & _ and that seems to be working fine. Many thanks for your responses and happy new year.

    Viewing 2 reply threads
    Reply To: Carrying forward a SQL command in the Window

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: