Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2002
    Location
    Charlotte NC
    Posts
    665

    Unanswered: Text Wrap in VBA Code

    Hey all
    I am trying to code in VBA and having a problem with screan space. Apparently there is a limit to the number of characters that you can have per line in the code and I have exceded it. Now I am trying to force a text wrap. I remeber from some where that if I embed a space and a _ then it will allow the text to wrap, but when I do that the text will not compile saying that it needs an end of statemnt operator.
    Any Ideas?
    Jim

  2. #2
    Join Date
    Nov 2001
    Posts
    336
    strSQL = "Select * " & _
    "From tblMyCoolTable " & _
    "Where UserID=200;"

    HTH, Igor

  3. #3
    Join Date
    Aug 2002
    Location
    Charlotte NC
    Posts
    665
    DoCmd.RunSQL "INSERT INTO Table_PCRKMS_Local_Data ( Trade, Week, Shipper, Sh_Concern, Sh_Office, Consignee, Cn_Concern, Cn_Office, Line, SC, [String], R_Country, Receipt, Load, Discharge, Delivery, D_Country, Cargo, BTN, Equ_Type, Equ_Size, Equ_Height, Equ, WGT, Containers, FFE, Freight, rNTV2, rNTV1, [RNTV1/FFE], [RNTV1/Container], [RNTV2/FFE], [RNTV2/Container], RMISFLAG, FMC, FMC_Coast )" & _
    "SELECT dbo_DM_LINE_RKMS_AGGR_TBL.Trade, dbo_DM_LINE_RKMS_AGGR_TBL.Week, dbo_DM_LINE_RKMS_AGGR_TBL.Shipper, dbo_DM_LINE_RKMS_AGGR_TBL.Sh_Concern, dbo_DM_LINE_RKMS_AGGR_TBL.Sh_Office, dbo_DM_LINE_RKMS_AGGR_TBL.Consignee, dbo_DM_LINE_RKMS_AGGR_TBL.Cn_Concern, dbo_DM_LINE_RKMS_AGGR_TBL.Cn_Office, dbo_DM_LINE_RKMS_AGGR_TBL.Line," & _
    "dbo_DM_LINE_RKMS_AGGR_TBL.SC, dbo_DM_LINE_RKMS_AGGR_TBL.String, dbo_DM_LINE_RKMS_AGGR_TBL.R_Country, dbo_DM_LINE_RKMS_AGGR_TBL.Receipt, dbo_DM_LINE_RKMS_AGGR_TBL.Load, dbo_DM_LINE_RKMS_AGGR_TBL.Discharge, dbo_DM_LINE_RKMS_AGGR_TBL.Delivery, dbo_DM_LINE_RKMS_AGGR_TBL.D_Country, dbo_DM_LINE_RKMS_AGGR_TBL.Cargo, dbo_DM_LINE_RKMS_AGGR_TBL.BTN, dbo_DM_LINE_RKMS_AGGR_TBL.Equ_Type, dbo_DM_LINE_RKMS_AGGR_TBL.Equ_Size, dbo_DM_LINE_RKMS_AGGR_TBL.Equ_Height, dbo_DM_LINE_RKMS_AGGR_TBL.Equ, Sum(dbo_DM_LINE_RKMS_AGGR_TBL.WGT) AS SumOfWGT, Sum(dbo_DM_LINE_RKMS_AGGR_TBL.Containers) AS SumOfContainers, Sum(dbo_DM_LINE_RKMS_AGGR_TBL.FFE) AS SumOfFFE," & _
    "Sum(dbo_DM_LINE_RKMS_AGGR_TBL.Freight) AS SumOfFreight, Sum(dbo_DM_LINE_RKMS_AGGR_TBL.rNTV2) AS SumOfrNTV2, Sum(dbo_DM_LINE_RKMS_AGGR_TBL.rNTV1) AS SumOfrNTV1, IIf([rmisflag]="N",IIf(Sum([ffe])=0,0,Sum([rntv1])/Sum([ffe])),Null) AS [RNTV1/FFE], IIf([rmisflag]="N",IIf(Sum([ffe])=0,0,Sum([rntv1])/Sum([containers])),Null) AS [RNTV1/Container], IIf([rmisflag]="N",IIf(Sum([ffe])=0,0,Sum([rntv2])/Sum([ffe])),Null) AS [RNTV2/FFE], IIf([rmisflag]="N",IIf(Sum([ffe])=0,0,Sum([rntv2])/Sum([containers])),Null) AS [RNTV2/Container], dbo_DM_LINE_RKMS_AGGR_TBL.RMISFLAG, dbo_DM_LINE_RKMS_AGGR_TBL.FMC, dbo_DM_LINE_RKMS_AGGR_TBL.FMC_Coast FROM dbo_DM_LINE_RKMS_AGGR_TBL"

    This is the code that I am trying and I am still gettign the error expected end of statment
    Jim

  4. #4
    Join Date
    Aug 2002
    Location
    Charlotte NC
    Posts
    665
    I figured it out needed to use single quotes in some of my criteria.
    thanx for the help
    jim

Posting Permissions

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