Buppy 0 Junior Poster in Training

Hi,

I have 2 tables. I need to insert data in both tables at the same time. The form is called Model1. It works fine. BUT, here's the thing - i need to take the auto increment id from the first table and then insert it into the second table. Basically, currently my code is like this:

$this->Model1->save($this->data);
$someTempvar = $this->Model1->find('all',array('conditions' => array('conditions to find the previously inserted record')));
$this->data['Model2'] = $this->data['Model1'];
$this->data['Model2']['fid'] = $someTempvar[0]['Model1']['id']
$this->Model2->save($this->data);

It tries to insert the data into second table, however the id returns NULL. How do i get the id of that recently inserted record?

Thanks