Using a function to assign a default value for a field in table definition
Posted on 2011-05-10
When I define a date type field i am able to set a default value using the functions Date() or Now(). Are these unique exceptions, or is there a way I could assign other functions to load a default field default value? I have a public function the retrieves a Session ID (i.e. 'Public GetSessionID() As Long). I use this value to identify who, what and when a record was modified. I'd like to assign a default value of 'GetSessionID()' to the field SessionID, but I get an 'Unknown Function' error when I try to save it. I suspect I could accomplish this in Access 2010 with the new macros that are available there, but I'm currently at Access 2007.
Is there some way I can accomplish this at the table definition level in Access 2007?