C
Cameron
I keep getting an error on a Dim statement saying that the word "database" is
a unknown user defined function. I am working on this database as the orginal
developer died and I am kind of baffled by certain database calls do not work
with it. The code I have under a click event is as follows:
Private Sub MoveToER_Click()
On Error GoTo Err_MoveToER_Click
Dim MyDB As DATABASE
Dim MyStudents As Recordset
Dim i, X As Integer
Set MyDB = CurrentDb
Set MyStudents = MyDB.OpenRecordset("SS_errors", dbOpenTable)
DoCmd.Hourglass True
For i = 0 To Me.lstErrors.ListCount
If Me.lstErrors.Selected(i) = True Then
With MyStudents
.AddNew
!SS_ErrorID = Me.SafeStart_number
!SS_errors = Me.lstSSers 'saves the errors in the
errors table. Need to have an ID assocated with the current record.
.Update
End With
End If
Next i
MyStudents.Close
MyDB.Close
Set MyDB = Nothing
Form.Refresh
DoCmd.Hourglass False
Err_MoveToER_Click:
MsgBox Err.Description
'Resume Exit_MoveToER_Click
End Sub
a unknown user defined function. I am working on this database as the orginal
developer died and I am kind of baffled by certain database calls do not work
with it. The code I have under a click event is as follows:
Private Sub MoveToER_Click()
On Error GoTo Err_MoveToER_Click
Dim MyDB As DATABASE
Dim MyStudents As Recordset
Dim i, X As Integer
Set MyDB = CurrentDb
Set MyStudents = MyDB.OpenRecordset("SS_errors", dbOpenTable)
DoCmd.Hourglass True
For i = 0 To Me.lstErrors.ListCount
If Me.lstErrors.Selected(i) = True Then
With MyStudents
.AddNew
!SS_ErrorID = Me.SafeStart_number
!SS_errors = Me.lstSSers 'saves the errors in the
errors table. Need to have an ID assocated with the current record.
.Update
End With
End If
Next i
MyStudents.Close
MyDB.Close
Set MyDB = Nothing
Form.Refresh
DoCmd.Hourglass False
Err_MoveToER_Click:
MsgBox Err.Description
'Resume Exit_MoveToER_Click
End Sub