1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
|
Private Function HeaderSqlStrUpdt()
Dim strSQL As String
strSQL = "Update tblImportCustSchemaFlat "
strSQL = strSQL & "Set SqlHeader = Field01DataTitle & ', ' & Field02DataTitle & ', ' & Field03DataTitle & ', ' & "
strSQL = strSQL & "Field04DataTitle & ', ' & Field05DataTitle & ', ' & Field06DataTitle & ', ' & Field07DataTitle & ', ' & "
strSQL = strSQL & "Field08DataTitle & ', ' & Field09DataTitle & ', ' & Field10DataTitle & ', ' & Field11DataTitle & ', ' & "
strSQL = strSQL & "Field12DataTitle & ', ' & Field13DataTitle & ', ' & Field14DataTitle & ', ' & Field15DataTitle & ', ' & "
strSQL = strSQL & "Field16DataTitle & ', ' & Field17DataTitle & ', ' & Field18DataTitle & ', ' & Field19DataTitle & ', ' & "
strSQL = strSQL & "Field20DataTitle & ', ' & Field21DataTitle & ', ' & Field22DataTitle & ', ' & Field23DataTitle & ', ' & "
strSQL = strSQL & "Field24DataTitle & ', ' & Field25DataTitle & ', ' & Field26DataTitle & ', ' & Field27DataTitle & ', ' & "
strSQL = strSQL & "Field28DataTitle & ', ' & Field29DataTitle & ', ' & Field30DataTitle & ', ' & Field31DataTitle & ', ' & "
strSQL = strSQL & "Field32DataTitle & ', ' & Field33DataTitle & ', ' & Field34DataTitle & ', ' & Field35DataTitle & ', ' & "
strSQL = strSQL & "Field36DataTitle & ', ' & Field37DataTitle & ', ' & Field38DataTitle & ', ' & Field39DataTitle & ', ' & "
strSQL = strSQL & "Field40DataTitle & ', ' & Field41DataTitle & ', ' & Field42DataTitle & ', ' & Field43DataTitle & ', ' & "
strSQL = strSQL & "Field44DataTitle & ', ' & Field45DataTitle & ', ' & Field46DataTitle & ', ' & Field47DataTitle & ', ' & "
strSQL = strSQL & "Field48DataTitle & ', ' & Field49DataTitle & ', ' & Field50DataTitle "
strSQL = strSQL & "WHERE (tblImportCustSchemaFlat.DefaultCustNbr=[Forms]![frmImportSchemaCheck]![DefaultCustNbr]) AND (tblImportCustSchemaFlat.ClaimTypeDesc=[Forms]![frmImportSchemaCheck]![txtClaimTypeDesc]);"
'Debug.Print strSQL
CurrentProject.Connection.Execute strSQL
'Debug.Print "strSQL ran"
End Function
Here is what it returns in the immediate window. Notice the break within Field38. This will run in a SQL query if I remove this break.
Update tblImportCustSchemaFlat Set SqlHeader = Field01DataTitle & ', ' & Field02DataTitle & ', ' & Field03DataTitle & ', ' & Field04DataTitle & ', ' & Field05DataTitle & ', ' & Field06DataTitle & ', ' & Field07DataTitle & ', ' & Field08DataTitle & ', ' & Field09DataTitle & ', ' & Field10DataTitle & ', ' & Field11DataTitle & ', ' & Field12DataTitle & ', ' & Field13DataTitle & ', ' & Field14DataTitle & ', ' & Field15DataTitle & ', ' & Field16DataTitle & ', ' & Field17DataTitle & ', ' & Field18DataTitle & ', ' & Field19DataTitle & ', ' & Field20DataTitle & ', ' & Field21DataTitle & ', ' & Field22DataTitle & ', ' & Field23DataTitle & ', ' & Field24DataTitle & ', ' & Field25DataTitle & ', ' & Field26DataTitle & ', ' & Field27DataTitle & ', ' & Field28DataTitle & ', ' & Field29DataTitle & ', ' & Field30DataTitle & ', ' & Field31DataTitle & ', ' & Field32DataTitle & ', ' & Field33DataTitle & ', ' & Field34DataTitle & ', ' & Field35DataTitle & ', ' & Field36DataTitle & ', ' & Field37DataTitle & ', ' & Field38DataTit
le & ', ' & Field39DataTitle & ', ' & Field40DataTitle & ', ' & Field41DataTitle & ', ' & Field42DataTitle & ', ' & Field43DataTitle & ', ' & Field44DataTitle & ', ' & Field45DataTitle & ', ' & Field46DataTitle & ', ' & Field47DataTitle & ', ' & Field48DataTitle & ', ' & Field49DataTitle & ', ' & Field50DataTitle WHERE (tblImportCustSchemaFlat.DefaultCustNbr=[Forms]![frmImportSchemaCheck]![DefaultCustNbr]) AND (tblImportCustSchemaFlat.ClaimTypeDesc=[Forms]![frmImportSchemaCheck]![txtClaimTypeDesc]);
|