LittleSmudge
Programmer
I have an update query
The Type of tblPCourse.EnrolmentStatus is Text(9)
Yet all I get when I run this is a MSAccess didn't update xxxx fields due to type conversion failure
Where xxxx is the number of record I'd expect it to update.
Yet if I run
It runs fine.
So it must be the Iif function.
What's wrong with it ?
G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
Code:
DoCmd.RunSQL "UPDATE tblImport INNER JOIN tblPCourse " _
& "ON (tblImport.Person_ID = tblPCourse.PersonRef) " _
& "AND (tblImport.CourseCode = tblPCourse.CourseRef) " _
& "AND (tblImport.EnrolmentDate = tblPCourse.EnrolmentDate) " _
& "SET tblPCourse.EnrolmentStatus = " _
& "IIf(tblImport.EnrolmentStatus = 1,'Current'," _
& "IIf(tblImport.EnrolmentStatus = 2,'Completed'," _
& "IIf(tblImport.EnrolmentStatus = 3,'Withdrawn',Null)));"
The Type of tblPCourse.EnrolmentStatus is Text(9)
Yet all I get when I run this is a MSAccess didn't update xxxx fields due to type conversion failure
Where xxxx is the number of record I'd expect it to update.
Yet if I run
Code:
DoCmd.RunSQL "UPDATE tblImportEnrol INNER JOIN tblPCourse " _
& "ON (tblImportPerson_ID = tblPnCourse.PersonRef) " _
& "AND (tblImport.CourseCode = tblPCourse.CourseRef) " _
& "AND (tblImport.EnrolmentDate = tblPCourse.EnrolmentDate) " _
& "SET tblPCourse.EnrolmentStatus = " _
& "'Completed';"
It runs fine.
So it must be the Iif function.
What's wrong with it ?
G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.