Domain aggregate functions

smowknm

New member
Local time
Today, 00:16
Joined
Jan 22, 2003
Messages
5
I have used the search but cannot find what I am looking for. When I try to define a default value using DMax or count I get an unknown function error. Is there a particular reference library that I need access to in order for this function to be seen?

Thank You,
P. Wickliff
 
From any code page where you see the Debug menu select Tools > References and uncheck any items marked "MISSING". That is usually the problem.

hth,
Jack
 
Not finding any references marked as missing.
 
I'm not sure what version of Access you are using but you should have these items checked in references for Access2000

Visual Basic for Applications
Microsoft Access 9.0 Oject Library
OLE Automation
Microsoft ActiveX Data Objects 2.1 Library

hth,
Jack
 
Using Access 2000 and all of these references are checked.

Thank You,
P. Wickliff
 
Make a real quick db with just a table (with some data) and a form. Try the DMax() code. If it works then something is wrong with the other db. If it doesn't work then I am stumped.

Jack
 
Works in a form, I am trying to make it compute a default value in a table elements definition. Basically, just in incrementer, the autonumber key skips numbers. Using an access page to retrieve/update data.
 
You can't run code from a table. Forms, queries or reports only...

Jack
 
You are welcome. I didn't realize you were trying to run the code in the table or we could have saved a bit of time, but that is how we learn...

If you use the DMax() in the On Current event of a form then code similar to this will do what you want:

If Me.NewRecord Then
On Error Resume Next
Me.MyNumber = Nz(DMax("[MyNumber]", "tblMyTable"), 0) + 1
End If

Change MyNumber to the name of the control on your form that is bound the field in your table that you want to incement when you move to a new record.

hth,
Jack
 

Users who are viewing this thread

Back
Top Bottom