Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Expected end of statement in Where clause plz help in fixing syntax

Status
Not open for further replies.

SAM453

Programmer
Jun 6, 2011
18
US
It's says expected end of statement in where clause
Can any one fix this plz

str = "SELECT Dump_BC_AP_DATA_DUMP.AP_Id, Dump_BC_AP_DATA_DUMP.Transaction_Type, " & _
" Dump_BC_AP_DATA_DUMP.Business_Unit_Id, Dump_BC_AP_DATA_DUMP.Station_Id, " & _
" Dump_BC_AP_DATA_DUMP.Business_Date, Dump_BC_AP_DATA_DUMP.Supplier_Id, " & _
" Dump_BC_AP_DATA_DUMP.Supplier_Name, Dump_BC_AP_DATA_DUMP.Supplier_Xref_Code, " & _
" Dump_BC_AP_DATA_DUMP.Supplier_Edi_Number, Dump_BC_AP_DATA_DUMP.Supplier_Terms, " & _
" Dump_BC_AP_DATA_DUMP.Transaction_Id, Dump_BC_AP_DATA_DUMP.Transaction_Date, " & _
" Dump_BC_AP_DATA_DUMP.Transaction_Number, Dump_BC_AP_DATA_DUMP.Control_Number FROM Dump_BC_AP_DATA_DUMP INNER JOIN lkp_vwStore ON Dump_BC_AP_DATA_DUMP.station_ID=lkp_vwStore.Station_ID WHERE ([lkp_vwStore].[dsm_name]) = [Forms]![BC3]![Combo13] & _
" and ([Dump_BC_AP_DATA_DUMP].[Business_Date]) Between [Forms]![BC3]![text0] and [Forms]![BC3]![text3]" & _
" order by Dump_BC_AP_DATA_DUMP.Station_Id ;
 
I typically break these into smaller sets of
Code:
str = "SELECT ...."
str = str & " FROM ..." & _
  "   "
str = str & " WHERE ...." & _
  "   "
str = str & " ORDER BY ...." & _
  "   "
There are limits to the number of line continuations and the length of the full string.
It looks like you might be missing a " in
Code:
 ...[Forms]![BC3]![Combo13]  & _

Duane
Hook'D on Access
MS Access MVP
 
How are ya SAM453 . . .

[blue]dhookom[/blue] has you:
Code:
[blue]   = [Forms]![BC3]![Combo13][COLOR=yellow red] "[/color] & _[/blue]
He's also correct about the number of line continuation characters you can have. My last count it was [blue]18 to 20[/blue].

[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top