Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strange error using Date function 2

Status
Not open for further replies.

Preka

Programmer
May 11, 2004
55
I'm getting a strange error using the date function on a form. This is an existing form/dbase, and it's shared from the server. The date appears just fine on every other computer that can access the dbase except for my desktop and my laptop. All other computers are running Win2000, mine are both running XP. If I attempt to edit the control using the date function, I get:

The function you entered can't be used in this expression.

* You may have used a DoEvents, Lbound, Ubound, Spc, or tab function in an expression.

* You may have used an SQL aggregate function, such as Count, in a design grid or in a calculated control or field.

This error appears if I try to move my cursor out of the date control, or attempt to move to form view.

One final thing: The NOW function works just fine (but that's not what I want to use)
 
Have you checked the references on your PC? Open any module and select Tools|References. Look for missing references.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
And are you using a different date format in your Windows environment: MM-DD-YYYY vs YYYY-MM-DD type of thing ? Access / Windows is supposed to handle this automatically, but I occasionaly come acorss a situation where strange things happen when the user uses a different date format than others sharing the same database.
 
I'm looking at my references right now, but it's all greek to me.

VB for apps, MS access 9.0 object library, OLE automation, MS activeX data objects 2.1 library are all checked, and there's a significantly long list of other references that are not.

What exactly would I be looking for?

Thanks
 
Preka,
Those references should be ok. Have you attempted to Compile your project while in a module? Have you looked and compared the checked references on other computers where there is no problem?

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
I'm getting same kind of error. I developed an access app/db on Win2K Office 2K pro. It has trouble running on a Win XP machine running Office XP. I have found one object library marked MISSING: shappmgr 1.0 Type Library. The module for this is C:\WINNT\System32\appwiz.cpl - control panel applet? When I browse I find this module is in that location as it is on the Win2K machine. Tried compiling and compiler chokes on function UCASE.
Any ideas would be great.

Nolan
 
What happens if you remove the missing reference ?
Anyway, in XP, this control panel applet is located (by default) here: c:\windows\system32\appwiz.cpl
This is the Add/Remove programs applet.
Are you sure your access app needs it ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I bet PHV is correct. Uncheck the MISSING reference and try to compile the project.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Yes. That was it. Don't know why it was in there. I found a note on MS knowledge base that said VBA won't compile if there are any MISSING references, so I unchecked and that error is gone.

I still have one error left - the date issue. I want to default a Date field in a form to the current date. I have set the Format to ShortDate and default Value =TODAY(). The form opens with #Name? in this field.

Thanks for the suggestion PHV. And Duane, you're right - I meant to say Add/Remove programs applet.
 
rptnut,
You mean PHV was correct regarding the Add/Remove...

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Regarding your #Name, your last error.

Instead of TODAY, use =DATE()

Note: You should consider giving PHV (and Duane) stars for their exceptional detective work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top