I got the code that wasn't working working:
Private Sub cboCourseID_AfterUpdate()
If DCount("CourseID", "tblBooking", "CourseID = [cboCourseID]") >= 5 Then
MsgBox "This course is full"
End If
End Sub
For some reason the equals sign made a big difference, thanks for all your help pbaldy...