Solved

Unknown Date Function

Posted on 2011-02-25
13
372 Views
Last Modified: 2012-05-11
I have a field in my database called "ActionDate", in the design of the table the default value I have set to "Date()" - I want the field to automatically populate with todays date when a record is created.

Words great on my computer but when I try to run the application on another computer in the office it comes up with this error: "Unknown function 'Date' in validation expression or default value on "tblActions.ActionDate"

What is the better way to assign today's date to a field upon record creation to avoid this issue?
0
Comment
Question by:gcgcit
  • 4
  • 4
  • 2
  • +2
13 Comments
 
LVL 92

Expert Comment

by:Patrick Matthews
ID: 34980210
gcgcit,

Please go to the VB Editor, and select Tools|References from the menu.  Are any listed as missing?

The Date() function is standard; when you see that error with a standard function, it is often a symptom of a broken reference.

Patrick
0
 
LVL 49

Expert Comment

by:Gustav Brock
ID: 34980221
You need to go to menu References and resolve any reference marked MISSING.

/gustav
0
 

Author Comment

by:gcgcit
ID: 34980619
Actually, just spoke with tester when I went to check the references on their machine and it's when they are trying to access the software through Citrix not straight through their machine.  All our machines seem fine.

What reference would hold the "Date" function?  So I can get the Citrix administrator to look into it.
0
 
LVL 49

Expert Comment

by:Gustav Brock
ID: 34980698
None. But that's the sympthom. It's a classic.

/gustav
0
 

Author Comment

by:gcgcit
ID: 34980731
I just got the administrator to open access in Citrix.  See attached photos for the references.

What should I do?
ee-references.jpg
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 34980783
What version of Access?
All updates installed (Office, Widows, Citrix...)
I am running two db's over Citrix and have not had issues with this error...

<just spoke with tester when I went to check the references on their machine and...>
And..., It is still not clear if any were marked "MISSING"
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 34980786
never mind, you posted the References just now...
0
 
LVL 49

Expert Comment

by:Gustav Brock
ID: 34980831
That seems OK.
Then remove one, press OK, add it back, press OK. That should do it.

/gustav
0
 

Author Comment

by:gcgcit
ID: 34981266
which reference should i remove and add back in?
0
 
LVL 49

Expert Comment

by:Gustav Brock
ID: 34981298
Anyone except the two top references which are non-removable.
It is just to "stirr the pot" ...

/gustav
0
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Access MVP) earned 500 total points
ID: 34981526
"What is the better way to assign today's date to a field upon record creation to avoid this issue?"

Use the Form Before Insert event, as follows:

Private Sub Form_BeforeInsert (Cancel As Integer)

   Me.ActionDate = Date()

End Sub

I avoid setting Default Values at the Table level because 1) I've seen them get blown out too many times due to corruption and what not and 2) ... When you do this, then on your form when you go to the New Record position ... you see already a (in this example) a Date value in a text box - even though the new record has not actually been created.  A lot of times, this confuses users ... making it look like there is already a record.

Using the BI event, you avoid this. The control will not populate until the first Bound field on the Form is edited.

However ... IF ... you actually do have a Reference issue here, this will not solve that problem.

mx
0
 

Author Closing Comment

by:gcgcit
ID: 34982255
In the end it wasn't a reference issue.  I replaced default values at table level with form before insert as per DatabaseMX's suggestion and voila - it works now on citrix!

Thank you for the additional information on the hazards of table level default values etc.
0
 
LVL 75
ID: 34982288
You are welcome ...

mx
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now