Hi! How is everyone doing? When I ran the below code minus the highlighted part it works and when the current code is ran the following error message appear Run time error 3061 To Few parameters Expected 1. Your help is greatly appreciated. Thanks.
Code:
strSQL = "SELECT MOB_SAILOR_INFO.ID, DLookUp(""[Sailor_Rank_Rate]"",""[CIAC]"",""[SAILOR_NAME]='"" & [SAILOR_NAME] & ""'"") AS [RANK/RATE], DLookUp(""[Assigned_CIAC_Name]"",""[CIAC]"",""[SAILOR_NAME]='"" & [SAILOR_NAME] & ""'"") AS [Assigned CIAC], MOB_SAILOR_INFO.SAILOR_NAME, MOB_SAILOR_INFO.[HOME #], MOB_SAILOR_INFO.[WORK #], MOB_SAILOR_INFO.[CELL #], MOB_SAILOR_INFO.Family_Contact, MOB_SAILOR_INFO.First_Attempt, MOB_SAILOR_INFO.[Contact_Made(1)], IIf([status(1)]=""S"" Or [status(2)]=""S"" Or [status(3)]=""S"" Or [status(4)]=""S"",""YES"",""NO"") AS [Mobilization Member], MOB_SAILOR_INFO.[Status(1)], MOB_SAILOR_INFO.Second_Attempt, MOB_SAILOR_INFO.[Contact_Made(2)], MOB_SAILOR_INFO.[Status(2)], MOB_SAILOR_INFO.Third_Attempt, MOB_SAILOR_INFO.[Contact_Made(3)], MOB_SAILOR_INFO.[Status(3)], MOB_SAILOR_INFO.Fourth_Attempt, MOB_SAILOR_INFO.[Contact_Made(4)], MOB_SAILOR_INFO.[Status(4)]," & _
"MOB_SAILOR_INFO.Comments, MOB_SAILOR_INFO.FM_First_Attempt, MOB_SAILOR_INFO.[FM_Contact_Made(1)]," & _
"MOB_SAILOR_INFO.[FM_Status(1)], MOB_SAILOR_INFO.FM_Second_Attempt, MOB_SAILOR_INFO.[FM_Contact_Made(2)], MOB_SAILOR_INFO.[FM_Status(2)], MOB_SAILOR_INFO.FM_Third_Attempt, MOB_SAILOR_INFO.[FM_Contact_Made(3)], MOB_SAILOR_INFO.[FM_Status(3)], MOB_SAILOR_INFO.FM_Fourth_Attempt, MOB_SAILOR_INFO.[FM_Contact_Made(4)], MOB_SAILOR_INFO.[FM_Status(4)], MOB_SAILOR_INFO.FM_Comments, MOB_SAILOR_INFO.MOB_Sailor_Status " & vbCrLf & _
"FROM MOB_SAILOR_INFO " & vbCrLf & _
"GROUP BY MOB_SAILOR_INFO.ID, DLookUp(""[Assigned_CIAC_Name]"",""[CIAC]"",""[SAILOR_NAME]='"" & [SAILOR_NAME] & ""'""), MOB_SAILOR_INFO.SAILOR_NAME, MOB_SAILOR_INFO.[HOME #], MOB_SAILOR_INFO.[WORK #], MOB_SAILOR_INFO.[CELL #], MOB_SAILOR_INFO.Family_Contact, MOB_SAILOR_INFO.First_Attempt, MOB_SAILOR_INFO.[Contact_Made(1)], MOB_SAILOR_INFO.[Status(1)], MOB_SAILOR_INFO.Second_Attempt, MOB_SAILOR_INFO.[Contact_Made(2)], MOB_SAILOR_INFO.[Status(2)], MOB_SAILOR_INFO.Third_Attempt, MOB_SAILOR_INFO.[Contact_Made(3)], MOB_SAILOR_INFO.[Status(3)], MOB_SAILOR_INFO.Fourth_Attempt, MOB_SAILOR_INFO.[Contact_Made(4)], MOB_SAILOR_INFO.[Status(4)], MOB_SAILOR_INFO.Comments, MOB_SAILOR_INFO.FM_First_Attempt, MOB_SAILOR_INFO.[FM_Contact_Made(1)], MOB_SAILOR_INFO.[FM_Status(1)], MOB_SAILOR_INFO.FM_Second_Attempt, MOB_SAILOR_INFO.[FM_Contact_Made(2)], MOB_SAILOR_INFO.[FM_Status(2)], MOB_SAILOR_INFO.FM_Third_Attempt, MOB_SAILOR_INFO.[FM_Contact_Made(3)], MOB_SAILOR_INFO.[FM_Status(3)]," & _
"MOB_SAILOR_INFO.FM_Fourth_Attempt , MOB_SAILOR_INFO.[FM_Contact_Made(4)], MOB_SAILOR_INFO.[FM_Status(4)], MOB_SAILOR_INFO.FM_Comments, MOB_SAILOR_INFO.MOB_Sailor_Status " & vbCrLf & _
"HAVING (((DLookUp(""[Assigned_CIAC_Name]"",""[CIAC]"",""[SAILOR_NAME]='"" & [SAILOR_NAME] & ""'""))[COLOR="Red"]=[Forms]![CIAC]![Process_CIACs][/COLOR]) AND ((IIf([status(1)]=""S"" Or [status(2)]=""S"" Or [status(3)]=""S"" Or [status(4)]=""S"",""YES"",""NO""))=""NO""));"