Corruption? Compile error? or what !

laxing22

Registered User.
Local time
Today, 06:56
Joined
Aug 12, 2003
Messages
14
OK, I have a DB that has a small amount of VBA. Bassically, I have a form that is used for data entry with a save command button, this button updates a hidden field that records the users log in id and a date stamp. I use this code on most of my DB and it just works. Anyhow - It works on this DB for a week or 2 then suddenly fails w/ a MSVB error bo stateing "Compile error: Can't find project or library" This is running on a LAN with only 2-3 users. I can restore the DB from a back up and it works fine, only to fail in a few days to weeks again. What is going on???
:confused: :mad:


BTW - the error first shows up on one specific users PC - the others with access to the DB will run fine for a few mins then they fail.

The fist section of the code to fail on is
Private Sub Save_Click()
Me.LastEditedBy.Value = GetNTUser & " " & Date & " " & Time
On Error GoTo Err_Save_Click

'Date' is the word that gets highlighted in the auto debugger
 
Last edited:
I am guessing that the offending PCs are missing a DLL reference. From a module, click Tools / References... and look for any that are listed as missing and fix them.

Also, try this instead...

Me.LastEditedBy.Value = GetNTUser & " " & Now()

HTH
 
ghudson said:
I am guessing that the offending PCs are missing a DLL reference. From a module, click Tools / References... and look for any that are listed as missing and fix them.

Also, try this instead...

Me.LastEditedBy.Value = GetNTUser & " " & Now()

HTH

OK, thanks, I'll try the now, but why does it work for a few days then fail? I reload the DB from backup and it works then fails in a few days / weeks - this just seems realy odd
 
Well, it failed again (on date in the compiler) I changed to 'Now' and it failed on 'Time'

*****************
Private Sub Save_Click()
Me.LastEditedBy.Value = GetNTUser & " " & Now & " " & Time
On Error GoTo Err_Save_Click
*****************

I tried to compile and it brought up a referances window and stoped on the section stating "MISSING: DatesLibV3a.mde"

It looks like it is looking in C:\WINNT\System32\

Like I said in the previous post, I replace the DB from the LAN backup and it works for a couple of day, then fails ! ! !
 
It has to be a reference problem.

Why are you using Now and Time?

Just use Now

Me.LastEditedBy.Value = GetNTUser & " " & Now

You can format it the way you want if the default date and time stamp are not what you like.

Me.LastEditedBy.Value = GetNTUser & " " & Format(Now(),"mm/dd/yyy hh:nn:ss")

HTH
 
Thanks, but that failed on FORMAT with the "unable to find project or libary" again. I removed the format and just used now - it then fails on the top........


**********************
Public Function GetNTUser() As String
On Error GoTo Err_GetNTUser
Dim strUserName As String
strUserName = String(100, Chr$(0)) ' <---- fails highliting on Chr$
GetUserName strUserName, 100
strUserName = Left$(strUserName, InStr(strUserName, Chr$(0)) - 1)
GetNTUser = StrConv(strUserName, vbProperCase)
Exit_GetNTUser:
Exit Function
Err_GetNTUser:
MsgBox "GetNTUser", Err.Number, Err.Description
Resume Exit_GetNTUser
End Function

***********************
 
lax,

I agree with ghudson, it is a reference problem.

Do a search here for "references". That will give you info on
the problem. There are also ways to programmatically set them.

Wayne
 
WayneRyan said:
Do a search here for "references". That will give you info on
the problem. There are also ways to programmatically set them.

I know I am missing a referance, as soon as I compile, it gives me the error of "Can't find project or libary"
It then brings up the Availible References window with 5 checked, the last checked being "MISSING: DatesLibV3a.mde"

It looks like it is looking in C:\WINNT\System32\

What I do not understand is were is it going? It is a small network that the DB is on.
Cuold this be a Service Pack need issue? My searches ended with someone telling that person to do a search. How does this dissapear?
 
Well. ok - responses are still welcom, but I made a temp fix. I checked one of my other (more complex) DB on the same server that is running the same code for tagging changes. It had 4 boxes (referances) checked (vs. 5 including the one titled missing) I unchecked the "missing" referance and the code works!

What is going on?
 
"MISSING: DatesLibV3a.mde"
My guess is that somebody in your company made their own db named "DatesLibV3a.mde" and put some custom functions in it. To protect their code, they converted the db to a MDE. Then they referenced the DatesLibV3a.mde db to the current db that is giving you the reference problems. Now the DatesLibV3a.mde file is not on your computer and the db is bugging out because it can not find the functions it needs. Unchecking the DatesLibV3a.mde reference is freeing your db from the DatesLibV3a.mde db and allowing your db to properly use the Date(), Time(), Now() "built-in" Access functions.

Am I on the right track?
 

Users who are viewing this thread

Back
Top Bottom