Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 421
  • Last Modified:

Unknown Date Function

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
gcgcit
Asked:
gcgcit
  • 4
  • 4
  • 2
  • +2
1 Solution
 
Patrick MatthewsCommented:
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
 
Gustav BrockCIOCommented:
You need to go to menu References and resolve any reference marked MISSING.

/gustav
0
 
gcgcitAuthor Commented:
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Gustav BrockCIOCommented:
None. But that's the sympthom. It's a classic.

/gustav
0
 
gcgcitAuthor Commented:
I just got the administrator to open access in Citrix.  See attached photos for the references.

What should I do?
ee-references.jpg
0
 
Jeffrey CoachmanMIS LiasonCommented:
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
 
Jeffrey CoachmanMIS LiasonCommented:
never mind, you posted the References just now...
0
 
Gustav BrockCIOCommented:
That seems OK.
Then remove one, press OK, add it back, press OK. That should do it.

/gustav
0
 
gcgcitAuthor Commented:
which reference should i remove and add back in?
0
 
Gustav BrockCIOCommented:
Anyone except the two top references which are non-removable.
It is just to "stirr the pot" ...

/gustav
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
"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
 
gcgcitAuthor Commented:
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
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
You are welcome ...

mx
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 4
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now