J
Julius_Council
I have an Access Database that allows me to send out a training module. When
the person has completed the training he/she clicks a button indicating that
they "have read" the training. I recently updated to Windows XP and now I'm
getting the error when I try to click the I read button to test the alert.
The error is:
Can't Find Project or library.
line of code that the error is referring me to is:
MyString = Space(mysize)
The word space is highlighted. Please advise. I have provided some of my
code below.
Public Function startup()
Dim mysize As Long
Dim MyString As String
Dim Currentuser As String
Dim CurrentDocument As String
mysize = 256
MyString = Space(mysize)
ret = GetUserName(MyString, mysize)
Currentuser = Left(MyString, 5)
GlobalCurrentUser = Currentuser
CurrentDocument = Command()
If CurrentDocument <> "" Then
' ret = MsgBox("By clicking on YES below, I agree that I have read
and understood the following Document: " & CurrentDocument, vbYesNo,
"Confirmation")
' If ret = vbYes Then
Dim myset As Recordset
Set myset = CurrentDb.OpenRecordset("Select * from Employeelog")
myset.FindFirst "(userid = '" & UCase(Currentuser) & "') and
(DocumentTitle = '" & CurrentDocument & "')"
If myset.NoMatch Then
myset.AddNew
myset("Userid") = UCase(Currentuser)
myset("DocumentTitle") = CurrentDocument
myset("Userreaddate") = Format(Now, "mm/dd/yyyy")
myset("userreadtime") = Format(Now, "Hh:Nn:Ss AM/PM")
myset.Update
myset.Close
MsgBox ("It has been recorded that you read " &
CurrentDocument & ".")
Else
MsgBox ("Records indicate you already read this document.")
End If
'End If
DoCmd.Quit
Else
DoCmd.OpenForm "Switchboard", acNormal
End If
End Function
the person has completed the training he/she clicks a button indicating that
they "have read" the training. I recently updated to Windows XP and now I'm
getting the error when I try to click the I read button to test the alert.
The error is:
Can't Find Project or library.
line of code that the error is referring me to is:
MyString = Space(mysize)
The word space is highlighted. Please advise. I have provided some of my
code below.
Public Function startup()
Dim mysize As Long
Dim MyString As String
Dim Currentuser As String
Dim CurrentDocument As String
mysize = 256
MyString = Space(mysize)
ret = GetUserName(MyString, mysize)
Currentuser = Left(MyString, 5)
GlobalCurrentUser = Currentuser
CurrentDocument = Command()
If CurrentDocument <> "" Then
' ret = MsgBox("By clicking on YES below, I agree that I have read
and understood the following Document: " & CurrentDocument, vbYesNo,
"Confirmation")
' If ret = vbYes Then
Dim myset As Recordset
Set myset = CurrentDb.OpenRecordset("Select * from Employeelog")
myset.FindFirst "(userid = '" & UCase(Currentuser) & "') and
(DocumentTitle = '" & CurrentDocument & "')"
If myset.NoMatch Then
myset.AddNew
myset("Userid") = UCase(Currentuser)
myset("DocumentTitle") = CurrentDocument
myset("Userreaddate") = Format(Now, "mm/dd/yyyy")
myset("userreadtime") = Format(Now, "Hh:Nn:Ss AM/PM")
myset.Update
myset.Close
MsgBox ("It has been recorded that you read " &
CurrentDocument & ".")
Else
MsgBox ("Records indicate you already read this document.")
End If
'End If
DoCmd.Quit
Else
DoCmd.OpenForm "Switchboard", acNormal
End If
End Function