Snipped from an evolt message from years ago (8/6/1999) when I asked this very question. Thanks Matt Warden. <snip> I like functions... I'm not sure if you can do this with straight SQL, but with ASP/ADO methods... FUNCTION Add() SET Data1....... Data1.AddNew Data1("myfield") = TrimNulll(myvalue) Data1.Update Add = Data1("ID") END FUNCTION TempID = Add() </snip> Does that help? Its also a common question, google it, you should find lots and lots of ways to do this.