WE all know that we can't join tables from different databases
Not sure if applicable in your case, but here are a few posts about querying across db's:
Querying multiple databases at once
PHP Mysql joins across databases
https://stackoverflow.com/a/5698396/183254
At any rate, you don't need to use a join; just query the other db to see if the thing is active
$DB2 = $this->load->database('otherdb', TRUE);
$active = $DB2->query('SELECT is_active blah...');
if($active)
{
//do other query
}
Update
This probably isn't syntactically correct, but should point you in the right direction. As always, user guide.
// load other db
$db2 = $this->load->db('otherdb',TRUE);
// get enrolled student id's from other db
$active_students = $db2->query('SELECT id FROM students WHERE enrolled = 1')->result();
// query this db for what you want
$this->db->select('count(IDNO), course, sum(student_balance)');
$this->db->where('school_term',2013);
$this->db->where('student_balance >',0);
// where_in will limit the query to the id's in $active_students
$this->db->where_in('id', $active_students);
// finally, execute the query on the student_balances table
$balances = $this->db->get('student_balances');