Code:
Set Radnik = MyDb.OpenRecordset("SELECT LDRadnik.JMBG,Radnik.ImePrezime, Raspored.Koeficijent, Radnik.BrojGod, LDRadnik.IznosNe1, LDRadnik.IznosNe2, _
& " LDRadnik.PorManji, LDRadnik.DSPO, LDRadnik.IznosIsp FROM ((Radnik INNER JOIN LDRadnik ON Radnik.JMBG = LDRadnik.JMBG) _
& " INNER JOIN Raspored ON LDRadnik.JMBG = Raspored.JMBG) INNER JOIN qryAdekvatnaSis ON Raspored.BrojPra = qryAdekvatnaSis.BrojPra _
& " WHERE GodinaMj = " & Me.GodinaMJ & "AND VrstaObr = '" & Me.cboVrstaObr & "'")
The code stops on this line, Radnik is "Dim Radnik As Recordset".
I copied the SQL string, pasted it in the immediate window and executed with the ?. Took the SQL pasted it into a new query in query designer, run the query and it works.
I refreshed all linked tables, even re-added the tables involved in the SQL statement but still getting the same error. I also tried with the , dbOpenDynaset, dbSeeChanges at the end
I will remove all the tables and link them again , all the tables involved are on the SQL Server
btw I can access all the tables from Access without any problems