Recent content by crwilliams

  1. C

    What's wrong with my code?

    Here is the remaining statements I need to add: I tried adding it before the "WHERE" and after and even one at a time. & " AND (tbl_Dept_Assignments.Dept_ID = tbl_TDB_Dept_Assignments.Dept_ID) " _ & " AND ((tbl_TDB_SME_Assignments.TDB_Designation)=1) " _ & " AND...
  2. C

    What's wrong with my code?

    I am getting much closer: This code actually ran without an error. Now I just need to add back on the "AND"'s. Do you think I should add the rest of the "AND" statements before the "WHERE"? Const strcQuerySQL As String = "SELECT DISTINCTROW tbl_Project_Team_Depts.Business_Unit_Name...
  3. C

    What's wrong with my code?

    Now even if I get rid of all the AND lines I still get the following error: Error Number 3075 Error Desciption: Syntax error (missing operator) in query expression '(((tbl_Regions.Region_Abbrev)=[Enter the Region])ME'))'. Again, ME is what I am placing in the parameter after I hit the button.
  4. C

    What's wrong with my code?

    I found that one....I did not have a space in "SELECTDISTINCTROW". When I added it, the previous error went away but now I have this one...Error Number: 3135 Syntax error missing operator in query expression. Then it lists the following: '(((tbl_Regions.Region_Abbrev)=[Enter the Region]) AND...
  5. C

    What's wrong with my code?

    I see what you did and I confirmed I had spaces after I copied your code. Also, I removed the last line as well and added appropriate punctuation afterwards. I am still getting the error. Is there a way for me to track down where the problem is? When I insert the old SQL it works fine.
  6. C

    What's wrong with my code?

    I realize I left out "SELECTDISTINCTROW so I added it. Now I'm getting this message: Error 3179 Invalid SQL statement; expected "Delete, Insert, Procedure, Select or Update.
  7. C

    What's wrong with my code?

    I have added quotes, line continuations and ampersands as you suggested. I did it in Word then copy/pasted into my code. Once again, its all red and I am now receiving the following error. Compile error: Expected: line number or label or statement or end of statement. Can someone please take a...
  8. C

    What's wrong with my code?

    I've tried and am very confused. Is there anyway you could post your rendition of how the SQL should be posted.
  9. C

    What's wrong with my code?

    Originally I just copy/pasted it in there and it all turned red with a syntax error. What am I doing wrong?
  10. C

    Help with a VB code

    I am so not very good at any of this. I posted this along with all the details in the "Modules and VBA" section. Originally I got my new SQL statement from the query I updated from the "SQL view" I tried to simply replace the text in my procedure with it and it all turned Red. That is when I...
  11. C

    What's wrong with my code?

    Also, here is the procedure I am updating: Notice, all I need to do is update the SQL statement since I changed my query On Error GoTo Error_GenerateOutlookEmailMessage ' Declare Local Constants. Const strcProcedureName As String = "GenerateOutlookEmailMessage()" Const strcErrNoHdr As String...
  12. C

    What's wrong with my code?

    Here is my original SQL statement. What do I need to do with this to paste it into my code so that the VB application will accept it? SELECT tbl_Project_Team_Depts.Business_Unit_Name, tbl_Project_Team_SME.[SME Name], tbl_Project_Team_SME.[SME Number], tbl_Project_Team_SME.[SME Email]...
  13. C

    What's wrong with my code?

    I have a SQL statement in a Procedure. My code works fine. I simply needed to replace this statement since I updated my query. I went to the SQL view and copied. I made the following adjustments: Replaced "AND" with "&" Replaced "INNER JOIN" with "JOIN" - because I was getting the...
  14. C

    Help with a VB code

    There could be many things wrong with my code but I am presently getting the following error: Error number 3135 "Syntax error in Join Operation" I am using this in an Access Database. I am updating a very long procedure someone else wrote. I need to change this statement only. I was receiving...
  15. C

    Help with a VB code

    Hi, I have a VB code in my database which has a DISTINCTROW statement I am trying to update. Am I allowed to post it here so someone can take a look and tell me what's wrong?
Back
Top Bottom