error in VBA code (1 Viewer)

Programming

Registered User.
Local time
Yesterday, 18:03
Joined
Jul 5, 2018
Messages
20
the following code gives me error of missing operator.
can anybody help

Me.RecordSource = "SELECT tblEmploymentEngagementEvaluation.EEVID, " _
& "tblEmploymentEngagementEvaluation.EmployerID , " _
& "tblEmployer.EmployerID , tblEmployer.OrganizationNameEnglish, " _
& "tblContacts.ContactID , tblContacts.FullName, tblSemester.SemesterID," _
& "tblSemester.SemesterName , tblEmploymentEngagementEvaluation.SemesterID," _
& "tblEmploymentEngagementEvaluation.SupervisorID , tblEmploymentEngagementEvaluation.OverAllEvaluation," _
& "tblEmploymentEngagementEvaluation.EvaluationDate , tblEmploymentEngagementEvaluation.Coordinatorcontact," _
& "tblEmploymentEngagementEvaluation.CoordinatorHelp , tblEmploymentEngagementEvaluation.CoordinatorVisitStudents," _
& "tblEmploymentEngagementEvaluation.StudentsPrepared , tblEmploymentEngagementEvaluation.Experience," _
& "tblEmploymentEngagementEvaluation.AdditionalComments" _
& "FROM tblEmployer INNER JOIN (tblSemester INNER JOIN (tblContacts INNER JOIN tblEmploymentEngagementEvaluation ON tblContacts.ContactID = tblEmploymentEngagementEvaluation.SupervisorID) ON tblSemester.SemesterID = tblEmploymentEngagementEvaluation.SemesterID) ON (tblEmploymentEngagementEvaluation.EmployerID = tblEmployer.EmployerID) AND (tblEmployer.EmployerID = tblContacts.EmployerID) WHERE tblEmploymentEngagementEvaluation.EEVID= " & Me.OpenArgs
 

June7

AWF VIP
Local time
Yesterday, 17:03
Joined
Mar 9, 2014
Messages
5,465
Need a space in front of FROM:

" FROM …

I will assume those spaces breaking up the field names are just typos in the post or thrown in by the forum.
 
Last edited:

isladogs

MVP / VIP
Local time
Today, 02:03
Joined
Jan 14, 2017
Messages
18,209
The SQL assumes OpenArgs is a NUMBER
If its a text string you need text delimiters:

Code:
WHERE tblEmploymentEngagementEvaluation.EEVID = '" & Me.OpenArgs & "'"

If your field names really do contain spaces then you need to enclose them in [].

In future please enclose your SQL in code tags as I did above using the # button on the reply window toolbar.
This makes it easier to read & avoids the extra spaces added by the forum software after every 50 characters
 

Users who are viewing this thread

Top Bottom