Why?
There is Access, and there is Jet. Access is the forms, reports, macros &
modules. The actual tables (and queries) are stored in Jet - a completely
seperate product. The default values are actioned by Jet - not Access. So,
if a default value used an Access user-defined function, Jet would have to
call back in to Access, to get the value of that function. Then, what would
happen if a Visual Basic program opened that Jet database, and created a
record in that table? Should Jet start a copy of Access, so that it could
call the function to get the correct default value? What if that copy of
Access ran an autoexec macro, and started the Access application (eg. opened
an Access form)? What would the poor VB user, make of all that?
So if you look at how it is architectured internaly, yo can see that it does
not make sense to expect a table default value to be able to use an Access
function. Access is just one of many possible front-ends to a Jet database.
You can't expect Jet to store any permanent "thing" (like a default value)
that requires for a >specific front-end program< to be running at that time.
HTH,
TC
"Ed Havelaar" <e.********@it.canterbury.ac.nz> wrote in message
news:8a******************************@news.teranew s.com...
I have a cool function that I want to use as a default value for a column
in my table. But I can't because apparently Access doesn't allow user
defined functions in expressions for default values. It's very annoying. Is
there any way around it?
What I need is something like AutoNumber, *except* I want the values to be
unique across six different tables. Any ideas?
Unknown function <name> in validation expression or default value on
<name>. (Error 3388)
The function you are referencing is either unknown (because the name is
invalid or misspelled) or is a type of function not allowed by the
ValidationRule or DefaultValue property. Among the types of functions not
allowed are user-defined, SQL aggregate functions.