Good morning. I'm new to this form so please forgive me until I learn. I hope this is in the right place.
I have this code in Access 2003 and what it is supposed to do is check how many times the program closes. If it closes on the 5th time it will do an automatic back up of my back end. I keep getting an error. This is the code:
Dim MySet As ADODB.Recordset
Dim MyCount As Integer
10 Set MySet = New ADODB.Recordset
20 MySet.Open "tblConfig", CurrentProject.Connection, , adLockOptimistic
30 MyCount = MySet!bkCount
40 If MyCount = 4 Then
50 Call Reset
Dim strPathFilename_OriginalBEDB As String
Dim strPathFilename_TemporaryBEDB As String
Dim blnKeepBack As Boolean
70 strPathFilename_OriginalBEDB = "C:\NCI Taps\TapsBE\Taps 06-08-01.mdb"
80 strPathFilename_TemporaryBEDB = "C:\NCI Taps\Backups\Taps 06-08-01.bak"
90 Call CompactBackendDatabaseFile_Custom(strPathFilename_OriginalBEDB, strPathFilename_TemporaryBEDB, True)
110 MySet!bkCount = MyCount + 1
130 End If
I believe where I'm getting the error is in line 30. I'm getting error 94. Invalid use of null. I don't know. It may be the commands don't work in 2003. I believe the reference is set correctly.
Any help would be appreciated.