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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inline VBA IIF SQL statement 1

Status
Not open for further replies.

larrydavid

Programmer
Jul 22, 2010
174
US
Hello, Is it possible to do an inline VBA IIF statement like this:

strSQL = "SELECT tbl_StepbyStep.RecID, IIf ([tbl_StepbyStep.Milestone] = True,"Y","N"), tbl_StepbyStep.PhaseStep, tbl_StepbyStep.numMethodology " &
"FROM tblProjects INNER JOIN tbl_StepbyStep ON tblProjects.numProjMethodology = tbl_StepbyStep.numMethodology " & _
"WHERE ((Not (tbl_StepbyStep.ParentLink) Is Null) AND ((tblProjects.numProjID)=" & Form_frmProjPortfolio.numProjID & ") AND ((CLng(Left([ParentLink],InStr(1,[ParentLink],'.',1)-1))) LIKE " & Me.cboPhase & ")) " & _
"ORDER BY tbl_StepbyStep.ID;"

I've been researching this but cannot get to the syntax error. Could someone please show me the correct syntax?

Thanks,
Larry
 
THANK YOU BOB! I knew it was something simple I was overlooking.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top