If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#9
|
|||
|
|||
SQL code works in Access SQL window but not in VBA SQL code
"Michael Gramelspacher" wrote in message ... On Sun, 10 Aug 2008 18:44:52 +0100, "bcap" wrote: "Michael Gramelspacher" wrote in message . .. On Sun, 10 Aug 2008 09:30:25 -0700 (PDT), wrote: try this dbs.Execute _ " a.AAA_UIC, a.ACRN, a.AMT, a.DOC_NUMBER, a.FIPC," & _ " a.REG_NUMB, a.TRAN_TYPE, a.DOV_NUM, a.PAA," & _ " a.COST_CODE, a.OBJ_CODE, a.EFY, a.REG_MO, a.RPT_MO," & _ " a.EFFEC_DATE, a.Orig_Sort, a.LTrim_BFY, a.LTrim_AAA," & _ " a.LTrim_REG, a.LTrim_DOV, a.AMT_Rev, a.CONCACT" & _ " INTO [CHOOSERev] FROM [CHOOSEData]" & _ " WHERE (((a.TRAN_TYPE) IN ('1K','2D'))" & _ " AND ((a.LTrim_REG) '7'));" How can he execute that string, it isn't even a statement? There's no SELECT... Yes, of course. Just a clerical error on my part, but not hard to correct now that the error has been pointed out. Indeed not difficult to correct (sorry, I didn't actually look at your string closely enough to realise that *only* the "SELECT" was missing). Unfortunately, the OP's reply to you suggests that he tried to execute the code *exactly* as you posted it. |
Thread Tools | |
Display Modes | |
|
|