0
votes

My access database crashed yesterday and I am trying to load it today to find an AutoExec 2001 error.

The application still works its but popping up the error message without any option to check the debug.

I have updated the trusted location as I read that could be a possibility.

The error happens around here:

 If DLookup("[Last_Opened]", "[tbl_logger]", "[Last_opened] = date()") Then
    DoCmd.Close acForm, "frm_Splash"
    DoCmd.OpenForm "frm_Manager_Stats_NEW_menu", acNormal
 Else

The form opens, then the error shows, I have also tried a compact and repair - Help

1
Please start with some basic debugging. Do you get the same error when running the code the auto-exec macro runs? Now you can get the exact location of the error. - Erik A

1 Answers

1
votes

You should check for Null:

If Not IsNull(DLookup("[Last_Opened]", "[tbl_logger]", "[Last_opened] = Date()")) Then
   DoCmd.Close acForm, "frm_Splash"
   DoCmd.OpenForm "frm_Manager_Stats_NEW_menu", acNormal
Else