473,416 Members | 1,924 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

Why no user-defined functions as default values? (error 3388)

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.
Nov 12 '05 #1
5 15652
On Sat, 10 Jan 2004 04:56:02 GMT, "Ed Havelaar"
<e.********@it.canterbury.ac.nz> wrote:

Read the help file on DefaultValue:
If the property setting is an expression, it can't contain
user-defined functions...

So you're left with putting your function call with each control that
has this field as its ControlSource.

-Tom.

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.


Nov 12 '05 #2
TC
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.

Nov 12 '05 #3
"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.


This is one of many reasons why databases have forms for data entry rather
than entering the data directly into the tables. This gives you far greater
flexibility and control over what happens. If you used a form, you could
either simply set the default value of your textbox to your cool function,
or you could use the form's events (such as BeforeInsert) to write any code
you like.
If you gave further details about the background to your need for a number
to be unique across 6 tables (such as is this number used as a key in other
tables) perhaps you would get some ideas. Who knows perhaps all 6 tables
should be combined into 1, perhaps another table should have an autonumber
with these tables related 1:1 with the main table, or perhaps your custom
function is indeed the best solution. It's difficult to say without further
details.

Fletcher
Nov 12 '05 #4
On Sat, 10 Jan 2004 04:56:02 GMT, "Ed Havelaar"
<e.********@it.canterbury.ac.nz> wrote:
What I need is something like AutoNumber, *except* I want the values to be
unique across six different tables. Any ideas?


What problem do you believe a value "unique across six different
tables" will solve?

--
Mike Sherrill
Information Management Systems
Nov 12 '05 #5
Mike Sherrill <MS*************@compuserve.com> wrote in
news:uc********************************@4ax.com:
On Sat, 10 Jan 2004 04:56:02 GMT, "Ed Havelaar"
<e.********@it.canterbury.ac.nz> wrote:
What I need is something like AutoNumber, *except* I want the values to be
unique across six different tables. Any ideas?


What problem do you believe a value "unique across six different
tables" will solve?


Group sex in pool halls?

--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)
Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Sandman | last post by:
Just looking for suggestion on how to do this in my Web application. The goal is to keep track of what a user has and hasn't read and present him or her with new material I am currently doing...
3
by: zlst | last post by:
Many technological innovations rely upon User Interface Design to elevate their technical complexity to a usable product. Technology alone may not win user acceptance and subsequent marketability....
2
by: Jesper Stocholm | last post by:
I have implemented role-based security within my ASP.Net application. However, it seems the role is not passed to the authentication ticket I create. I want to use it to display/hide some...
5
by: Michelle Stone | last post by:
Hi everybody I am writing a simple asp.net application using form authentication. I store the list of all users and their passwords in an SQL Server database table. My client recently told me...
1
by: Shourie | last post by:
I've noticed that none of the child controls events are firing for the first time from the dynamic user control. Here is the event cycle. 1) MainPage_load 2) User control1_Load user clicks a...
4
by: Guadala Harry | last post by:
Is there any way for one Session to remove and update objects in another Session? I seriously doubt it, but thought I'd ask. Here's why: I have some data that is unique per user (or per session -...
17
by: Alphonse Giambrone | last post by:
I am building a web app for users to add/edit data. They may add/edit several records during a session. When they are done (not necessarily immediately, could be 10 or more minutes later), I need...
4
by: louise raisbeck | last post by:
Resending this as own topic as didnt get answer from original. Would be grateful for a response from anyone that knows. Thanks. Hi there, I found your post really helpful..but i wondered if, once...
9
by: Gordon | last post by:
I want to add a feature to a project I'm working on where i have multiple users set up on my Postgres database with varying levels of access. At the bare minimum there will be a login user who...
3
by: shapper | last post by:
Hello, On my web site I have a property, Visitor, which is available for Anonymous users: public class Visitor { public CultureInfo Culture { get; set; } public List<GuidPolls { get; set;...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.