Error Message: "Undefined function "Date" in expression"

A

Archidrb

This morning users in my database started getting this message hen opening
the database. I use an autoexec command to start the database and open a
(splash scrren). This form that opens shows the most up to date version
number, so I know right there the ODBC connection to the SQL Server backend
is working. Then when that form closes the main menu opens.

As part of the main menu, a bit of code goes out and grabs the user's LAN ID
and populates it into a hidden field on the main menu. This field then
allows the user to update records and their name automatically populates.
This name also limits access to certain bits of the database using macros.

Each users gets this error four times, then the VBA de-bugging window opens
and the code attached to this LAN ID process opens. It highlights the line
containing the name of the function - which of course had not to do with a
'Date'.

Here is the code, I removed the (green) notes to save space and reading time.


Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long

Function fOSUserName() As String
Dim lngLen As Long, lngX As Long
Dim strUserName As String
strUserName = String$(254, 0)
lngLen = 255
lngX = apiGetUserName(strUserName, lngLen)
If (lngX > 0) Then
fOSUserName = Left$(strUserName, lngLen - 1)
Else
fOSUserName = vbNullString
End If
End Function

Did Microsoft release an update or hotfix that is causing this problem? Any
other ideas?
 
A

Archidrb

I should also mention that I am not having this problem, but four of my end
users are.
 
A

Archidrb

SQL Server backend connected using ODBC. I have a design master that is
replicated to a "master replica", then each user has their own copy (replica)
of the front end made from the master replica. This way I can make
structural changes, synch to the master replica, then each user can
synchronize the changes.

ruralguy via AccessMonster.com said:
Is your application split FrontEnd and BackEnd and does everyone have their
own copy of the FrontEnd? Or is this not a MultiUser application? Are the
users using MDE or MDB? Are there any reference errors that have cropped up?
I should also mention that I am not having this problem, but four of my end
users are.
You did not mention what version of Access you are using nor the OS in play.
[quoted text clipped - 34 lines]
Did Microsoft release an update or hotfix that is causing this problem? Any
other ideas?
 
A

Archidrb

MDB's.

The error says "Undefined function 'Date' in expression". It pops-up four
times upon opening the database, then the VBA code debug window opens to the
code that runs to paste the users LAN ID onto the main menu. Then closing
the debugger allows the database to open, but the name does not paste.

I know that the SQL Server backend is connecting because there is a splash
form that comes up first showing the version of the database. The version is
stored in a SQL table in the backend. So whatever is causing the problem
occurs after the ODBC has opened/connected.



ruralguy via AccessMonster.com said:
MDE or MDB's? Any there any Reference errors, bogus or otherwise?
SQL Server backend connected using ODBC. I have a design master that is
replicated to a "master replica", then each user has their own copy (replica)
of the front end made from the master replica. This way I can make
structural changes, synch to the master replica, then each user can
synchronize the changes.
Is your application split FrontEnd and BackEnd and does everyone have their
own copy of the FrontEnd? Or is this not a MultiUser application? Are the
[quoted text clipped - 8 lines]
Did Microsoft release an update or hotfix that is causing this problem? Any
other ideas?

--
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
 
A

Archidrb

Here was the problem:

On several (most) of the members of my team a Reference was missing. The
reference was called "Microsoft Windows Common Controls-2 6.0 (SP6)".

I had the reference on my laptop and it was located on my machine at:
C:\Windows\System32\ and called MSCOMCT2.OCX

Here's what I did:

I made a copy of my OCX file to a network location, went to each affected
user's machine and copied the file back to their System32 folder.

I did not even need to go through all of the "Reference" steps in the link
provided. As soon as the OCX file was replaced, the database worked.

Thank you for your help!


ruralguy via AccessMonster.com said:
Have you checked for any missing references?
http://www.accessmvp.com/djsteele/AccessReferenceErrors.html
MDB's.

The error says "Undefined function 'Date' in expression". It pops-up four
times upon opening the database, then the VBA code debug window opens to the
code that runs to paste the users LAN ID onto the main menu. Then closing
the debugger allows the database to open, but the name does not paste.

I know that the SQL Server backend is connecting because there is a splash
form that comes up first showing the version of the database. The version is
stored in a SQL table in the backend. So whatever is causing the problem
occurs after the ODBC has opened/connected.
MDE or MDB's? Any there any Reference errors, bogus or otherwise?
[quoted text clipped - 9 lines]
Did Microsoft release an update or hotfix that is causing this problem? Any
other ideas?

--
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
 
P

Peter Hibbs

This may be due to a Windows Security update. I see that MSCOMCT2.OCX
is one of the affected controls. Have a look at :-

http://support.microsoft.com/kb/957924
and
http://www.microsoft.com/technet/security/advisory/960715.mspx

Peter Hibbs.

Here was the problem:

On several (most) of the members of my team a Reference was missing. The
reference was called "Microsoft Windows Common Controls-2 6.0 (SP6)".

I had the reference on my laptop and it was located on my machine at:
C:\Windows\System32\ and called MSCOMCT2.OCX

Here's what I did:

I made a copy of my OCX file to a network location, went to each affected
user's machine and copied the file back to their System32 folder.

I did not even need to go through all of the "Reference" steps in the link
provided. As soon as the OCX file was replaced, the database worked.

Thank you for your help!


ruralguy via AccessMonster.com said:
Have you checked for any missing references?
http://www.accessmvp.com/djsteele/AccessReferenceErrors.html
MDB's.

The error says "Undefined function 'Date' in expression". It pops-up four
times upon opening the database, then the VBA code debug window opens to the
code that runs to paste the users LAN ID onto the main menu. Then closing
the debugger allows the database to open, but the name does not paste.

I know that the SQL Server backend is connecting because there is a splash
form that comes up first showing the version of the database. The version is
stored in a SQL table in the backend. So whatever is causing the problem
occurs after the ODBC has opened/connected.

MDE or MDB's? Any there any Reference errors, bogus or otherwise?

[quoted text clipped - 9 lines]
Did Microsoft release an update or hotfix that is causing this problem? Any
other ideas?

--
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
 
A

Archidrb

Thanks, Peter. I forwarded these links to my friend in the IT department
that is involved in rolling out this patch/upgrade. I suspect there is
nothing they can do to keep from having to reinstall this OCX file on (many)
user's machines.

And a big thanks to Ruralguy for helping point me to the problem. I love
solving problems and I needed a place to start!


Peter Hibbs said:
This may be due to a Windows Security update. I see that MSCOMCT2.OCX
is one of the affected controls. Have a look at :-

http://support.microsoft.com/kb/957924
and
http://www.microsoft.com/technet/security/advisory/960715.mspx

Peter Hibbs.

Here was the problem:

On several (most) of the members of my team a Reference was missing. The
reference was called "Microsoft Windows Common Controls-2 6.0 (SP6)".

I had the reference on my laptop and it was located on my machine at:
C:\Windows\System32\ and called MSCOMCT2.OCX

Here's what I did:

I made a copy of my OCX file to a network location, went to each affected
user's machine and copied the file back to their System32 folder.

I did not even need to go through all of the "Reference" steps in the link
provided. As soon as the OCX file was replaced, the database worked.

Thank you for your help!


ruralguy via AccessMonster.com said:
Have you checked for any missing references?
http://www.accessmvp.com/djsteele/AccessReferenceErrors.html

Archidrb wrote:
MDB's.

The error says "Undefined function 'Date' in expression". It pops-up four
times upon opening the database, then the VBA code debug window opens to the
code that runs to paste the users LAN ID onto the main menu. Then closing
the debugger allows the database to open, but the name does not paste.

I know that the SQL Server backend is connecting because there is a splash
form that comes up first showing the version of the database. The version is
stored in a SQL table in the backend. So whatever is causing the problem
occurs after the ODBC has opened/connected.

MDE or MDB's? Any there any Reference errors, bogus or otherwise?

[quoted text clipped - 9 lines]
Did Microsoft release an update or hotfix that is causing this problem? Any
other ideas?

--
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top