Ошибка 2585 access

My Access form resets a user password that is stored in the database using a SHA-256 encryption.

I’m given the below error.

Run Time error ‘2585’:
This action can’t be carried out while processing a form or report event.

I tried the «DoEvents» function just before «DoCmd.Close» and I receive the same error.

Private Sub cmdReset_Click()

If (IsNull(Me.txtConfirm) Or IsNull(Me.TxtPassword)) Then
    MsgBox "Either the password or confirmation field are empty! Please try again", , ""
Else
    If (Me.txtConfirm.Value = Me.TxtPassword) Then
        If (Me.txtConfirm = "password" Or Me.TxtPassword = "password") Then
            MsgBox "Cannot use 'password' as a password!" & Chr(13) & Chr(13) & "Please try again", , ""
        Else
            MsgBox "Your password has been reset!", , ""
            Call Reset_Password(DLookup("Username", "getCurrentUser"), _
                                SHA256(Me.txtConfirm, True))
            DoCmd.Close
            DoCmd.OpenForm "frmLogin"
        End If
    Else
        MsgBox "The passwords you entered do not match!" & Chr(13) & Chr(13) & "Please try again", , ""
    End If
End If

End Sub

  • Remove From My Forums
  • Вопрос

  • Hi All,

    I have a form in Access 2007. I am using an OnExit event on a text box
    control to check if a record exists before the current record is added. If the
    DOES exist, I have a msgbox that offers the user the ability to look at the
    existing record details or not. In either case, DoCmd.Close acForm, Me.Name
    occurs. The procedure only carries through to the end if the record does not
    exist.

    When the DoCmd.Close is executed, I get a «Run-time error ‘2585’: This action

    can’t be carried out while processing a form or report event.»

    I am at a loss as to the cause of this error since the event in question is a
    control event not a form event.

    I have also discovered that the form begins the process of closing but the close sequence is halted.

    Any ideas?

    Cheers


    Stephen, RedGalaxy Darwin, Australia

Ответы

  • Hi RedGalaxy

    If you want to check if the record already exists you should use the BeforeUpdate event of the form and there check, if it’s a new record. If so then cancel the event and undo the changes.

    Example:

    Private Sub Form_BeforeUpdate(Cancel As Integer)
      If Me.NewRecord Then
        If DCount("*", "YourTable", "YourID=" & Me!YourID) > 0 Then
          Cancel = True
          MsgBox "Record exists already"
          Me.Undo
        End If
      End If
    End Sub

    After this you should be able to close the form.

    HTH

    Henry

    • Помечено в качестве ответа

      15 января 2013 г. 1:04

Форма My Access сбрасывает пароль пользователя, который хранится в базе данных с использованием шифрования SHA-256.

Я получил следующую ошибку.

Ошибка времени выполнения ‘2585’:
Это действие невозможно выполнить при обработке формы или отчета о событии.

Я попробовал функцию «DoEvents» как раз перед «DoCmd.Close», и я получаю ту же ошибку.

Private Sub cmdReset_Click()

If (IsNull(Me.txtConfirm) Or IsNull(Me.TxtPassword)) Then
    MsgBox "Either the password or confirmation field are empty! Please try again", , ""
Else
    If (Me.txtConfirm.Value = Me.TxtPassword) Then
        If (Me.txtConfirm = "password" Or Me.TxtPassword = "password") Then
            MsgBox "Cannot use 'password' as a password!" & Chr(13) & Chr(13) & "Please try again", , ""
        Else
            MsgBox "Your password has been reset!", , ""
            Call Reset_Password(DLookup("Username", "getCurrentUser"), _
                                SHA256(Me.txtConfirm, True))
            DoCmd.Close
            DoCmd.OpenForm "frmLogin"
        End If
    Else
        MsgBox "The passwords you entered do not match!" & Chr(13) & Chr(13) & "Please try again", , ""
    End If
End If

End Sub

2017-09-28 15:11

1
ответ

Решение

Попробуйте изменить эти команды:

DoCmd.Close
DoCmd.OpenForm "frmLogin"

или переместите последнюю команду в событие Unload формы.

2017-09-28 15:26

  • #1

Hi all,

I get this error 2585 This action can’t be carried out while processing a form or report event. This happens when I enter a password into my form in order to open any other one. When the password is correct, I want it to open an administrator form, close the form (Main Start) which has the button to open the login form, and close the login form . However when the password is correct this error pops up and the login form does not close. Any help would be appreciated.

Private Sub txtPassword_LostFocus()
Dim PassWord As String
strPassword = «12345»
If Me.txtPassword = strPassword Then
DoCmd.OpenForm «Menuboard Admin»
DoCmd.Close acForm, «Menuboard Main Start»
DoCmd.Close acForm, «Menuboard Login»
Else
MsgBox («You’re not authorized for Administrator access.»)
End If
End Sub

pbaldy


  • #2

Try the after update event instead of the lost focus event.

  • #3

Try the after update event instead of the lost focus event.

Thank you very much that worked! How come after update worked and lost focus did not?

And one more question. What would the code be for if the password is incorrect, clear the text that was entered into the textbox. And I’m assuming this code would be placed after «else» in the code above.

Last edited:

pbaldy


  • #4

As the error implies, in the lost focus event Access is still working on leaving the textbox, so it can’t close the form (like you can’t close a door if you’re foot is still in it). In the after update event, it’s done with the textbox thus free to close the form.

You can set the textbox value to Null or «» to clear it.

  • #5

As the error implies, in the lost focus event Access is still working on leaving the textbox, so it can’t close the form (like you can’t close a door if you’re foot is still in it). In the after update event, it’s done with the textbox thus free to close the form.

You can set the textbox value to Null or «» to clear it.

Perfect, worked like a charm. Thanks!!

pbaldy


  • #7

Try the after update event instead of the lost focus event.

Hello dear pbaldy
I have a database which has a Login form and a Main Menu. I want when users enter their Username and Password and then click Enter button, Login form be closed and then Main Menu be opened.
I put the code on Enter button, but in gives error 2585.

Can you please help me to solve this problem?

Thanks in advance

  • #8

Are you sure that you have read this thread?

pbaldy


  • #9

Agree, and what exactly is your code and where exactly is it (what event, what control)?

  • #10

Agree, and what exactly is your code and where exactly is it (what event, what control)?

Thanks;

The Login form controls are:
cboUser
txtPassword
cmdLogin
cmdCancel

The code is put on Enter and Click events of cmdLogin. The using code is a function called LoginCode:

Public Sub LoginCode()
If IsNull([cboUser]) = True Then ‘Check UserName
MsgBox «Please choose the username.»
ElseIf IsNull([txtPassword]) = True Then ‘Check Password
MsgBox «Please enter your password.»
Else
‘Compare value of txtPassword with the saved Password in tblUsers
If Me.txtPassword.Value = DLookup(«Password», «tblUsers», «[Username]='» & Me.cboUser.Value & «‘») Then
strUser = Me.cboUser.Value ‘Set the value of strUser declared as Global Variable
strRole = DLookup(«Role», «tblUsers», «[Username]='» & Me.cboUser.Value & «‘») ‘set the value of strRole declared as Global Variable
If DLookup(«[Gender]», «tblUsers», «[Username]='» & Me.cboUser.Value & «‘») Like «Male» Then
MsgBox «Welcome Mr. » & strUser & «!», vbOKOnly, «Welcome»
Else
MsgBox «Welcome Ms. » & strUser & «!», vbOKOnly, «Welcome»
End If
DoCmd.OpenForm «frmMainMenu»
Else
MsgBox «You are not allowed to use this database. Contact with the administrator», vbCritical, «Warning!»
Application.Quit
End If
End If
End Sub

pbaldy


  • #11

For starters try taking it out of the enter event. Leave it in the click event only.

smig

Registered User.


  • #12

Why quit after showing the warning? What if the user had a mistake?
Take him back to the login screen having also the quit button.

Code should only be in the OnClick event.
Put code directly into the event. No need for another SUB.

Where do you close the login form?

Please put you code into a

Last edited:

  • #13

For starters try taking it out of the enter event. Leave it in the click event only.

Thank you my friend. :)
It solved!

pbaldy


Icon Ex Номер ошибки: Ошибка 2585
Название ошибки: This action can’t be carried out while processing a form or report event
Описание ошибки: This action can’t be carried out while processing a form or report event.@A macro specified as the OnOpen, OnLoad, OnClose, OnFormat, OnRetreat, OnPage, or OnPrint property setting contains an invalid action for the property.@When you click OK, an Action
Разработчик: Microsoft Corporation
Программное обеспечение: Microsoft Access
Относится к: Windows XP, Vista, 7, 8, 10, 11

Объяснение «This action can’t be carried out while processing a form or report event»

«This action can’t be carried out while processing a form or report event» обычно называется формой «ошибки времени выполнения». Разработчики тратят много времени и усилий на написание кода, чтобы убедиться, что Microsoft Access стабилен до продажи продукта. К сожалению, такие проблемы, как ошибка 2585, могут не быть исправлены на этом заключительном этапе.

Пользователи Microsoft Access могут столкнуться с сообщением об ошибке после выполнения программы, например «This action can’t be carried out while processing a form or report event.@A macro specified as the OnOpen, OnLoad, OnClose, OnFormat, OnRetreat, OnPage, or OnPrint property setting contains an invalid action for the property.@When you click OK, an Action». Если возникает ошибка 2585, разработчикам будет сообщено об этой проблеме через уведомления об ошибках, которые встроены в Microsoft Access. Microsoft Corporation вернется к коду и исправит его, а затем сделает обновление доступным для загрузки. Следовательно, разработчик будет использовать пакет обновления Microsoft Access для устранения ошибки 2585 и любых других сообщений об ошибках.

Проблема с исходным кодом Microsoft Access приведет к этому «This action can’t be carried out while processing a form or report event», чаще всего на этапе запуска. Проанализируем некоторые из наиболее распространенных причин ошибок ошибки 2585 во время выполнения:

Ошибка 2585 Crash — это типичная ошибка 2585 во время выполнения, которая полностью аварийно завершает работу компьютера. Это возникает, когда Microsoft Access не реагирует на ввод должным образом или не знает, какой вывод требуется взамен.

Утечка памяти «This action can’t be carried out while processing a form or report event» — при утечке памяти Microsoft Access это может привести к медленной работе устройства из-за нехватки системных ресурсов. Возможные искры включают сбой освобождения, который произошел в программе, отличной от C ++, когда поврежденный код сборки неправильно выполняет бесконечный цикл.

Ошибка 2585 Logic Error — Компьютерная система создает неверную информацию или дает другой результат, даже если входные данные являются точными. Когда точность исходного кода Microsoft Corporation низкая, он обычно становится источником ошибок.

Большинство ошибок This action can’t be carried out while processing a form or report event являются результатом отсутствия или повреждения версии файла, установленного Microsoft Access. Как правило, решить проблему можно заменой файла Microsoft Corporation. Более того, поддержание чистоты реестра и его оптимизация позволит предотвратить указание неверного пути к файлу (например This action can’t be carried out while processing a form or report event) и ссылок на расширения файлов. По этой причине мы рекомендуем регулярно выполнять очистку сканирования реестра.

Типичные ошибки This action can’t be carried out while processing a form or report event

Наиболее распространенные ошибки This action can’t be carried out while processing a form or report event, которые могут возникнуть на компьютере под управлением Windows, перечислены ниже:

  • «Ошибка This action can’t be carried out while processing a form or report event. «
  • «Ошибка программного обеспечения Win32: This action can’t be carried out while processing a form or report event»
  • «This action can’t be carried out while processing a form or report event столкнулся с проблемой и закроется. «
  • «Файл This action can’t be carried out while processing a form or report event не найден.»
  • «This action can’t be carried out while processing a form or report event не найден.»
  • «Ошибка запуска программы: This action can’t be carried out while processing a form or report event.»
  • «This action can’t be carried out while processing a form or report event не выполняется. «
  • «This action can’t be carried out while processing a form or report event выйти. «
  • «Неверный путь к программе: This action can’t be carried out while processing a form or report event. «

Ошибки This action can’t be carried out while processing a form or report event EXE возникают во время установки Microsoft Access, при запуске приложений, связанных с This action can’t be carried out while processing a form or report event (Microsoft Access), во время запуска или завершения работы или во время установки ОС Windows. Выделение при возникновении ошибок This action can’t be carried out while processing a form or report event имеет первостепенное значение для поиска причины проблем Microsoft Access и сообщения о них вMicrosoft Corporation за помощью.

This action can’t be carried out while processing a form or report event Истоки проблем

Проблемы This action can’t be carried out while processing a form or report event могут быть отнесены к поврежденным или отсутствующим файлам, содержащим ошибки записям реестра, связанным с This action can’t be carried out while processing a form or report event, или к вирусам / вредоносному ПО.

Особенно ошибки This action can’t be carried out while processing a form or report event проистекают из:

  • Недопустимая или поврежденная запись This action can’t be carried out while processing a form or report event.
  • Вредоносные программы заразили This action can’t be carried out while processing a form or report event, создавая повреждение.
  • This action can’t be carried out while processing a form or report event злонамеренно или ошибочно удален другим программным обеспечением (кроме Microsoft Access).
  • Другая программа, конфликтующая с This action can’t be carried out while processing a form or report event или другой общей ссылкой Microsoft Access.
  • Поврежденная загрузка или неполная установка программного обеспечения Microsoft Access.

Продукт Solvusoft

Загрузка
WinThruster 2022 — Проверьте свой компьютер на наличие ошибок.

Совместима с Windows 2000, XP, Vista, 7, 8, 10 и 11

Установить необязательные продукты — WinThruster (Solvusoft) | Лицензия | Политика защиты личных сведений | Условия | Удаление

  • Remove From My Forums
  • Question

  • Hi All,

    I have a form in Access 2007. I am using an OnExit event on a text box
    control to check if a record exists before the current record is added. If the
    DOES exist, I have a msgbox that offers the user the ability to look at the
    existing record details or not. In either case, DoCmd.Close acForm, Me.Name
    occurs. The procedure only carries through to the end if the record does not
    exist.

    When the DoCmd.Close is executed, I get a «Run-time error ‘2585’: This action

    can’t be carried out while processing a form or report event.»

    I am at a loss as to the cause of this error since the event in question is a
    control event not a form event.

    I have also discovered that the form begins the process of closing but the close sequence is halted.

    Any ideas?

    Cheers


    Stephen, RedGalaxy Darwin, Australia

Answers

  • Hi RedGalaxy

    If you want to check if the record already exists you should use the BeforeUpdate event of the form and there check, if it’s a new record. If so then cancel the event and undo the changes.

    Example:

    Private Sub Form_BeforeUpdate(Cancel As Integer)
      If Me.NewRecord Then
        If DCount("*", "YourTable", "YourID=" & Me!YourID) > 0 Then
          Cancel = True
          MsgBox "Record exists already"
          Me.Undo
        End If
      End If
    End Sub

    After this you should be able to close the form.

    HTH

    Henry

    • Marked as answer by

      Tuesday, January 15, 2013 1:04 AM

This code was running without a hitch, but now getting Error 2585.

I have looked at Gustav’s answer and Gord Thompson’s answer but unless I am missing something (quite possible!) the first does not work and the second seems inapplicable. I saw on another site a suggestion that there might be a duplicate record ID, but I check for that possibility.

I put a call to DoEvent() in response to this error but it returns zero. I also wait for 10 seconds to let other processes run. Still receive the error.

Private Sub SaveData_Click()
  Dim myForm As Form
  Dim myTextBox As TextBox
  Dim myDate As Date
  Dim myResponse As Integer

If IsNull(Forms!Ecoli_Data!DateCollected.Value) Then

  myReponse = myResponse = MsgBox("You have not entered all the required data. You may quit data entry by hitting 'Cancel'", vbOKOnly, "No Sample Date")
  Forms!Ecoli_Data.SetFocus
  Forms!Ecoli_Data!Collected_By.SetFocus
  GoTo endOfSub
End If

If Me.Dirty Then Me.Dirty = False

myDate = Me.DateCollected.Value

Dim yearAsString As String, monthAsString As String, dayAsString As String, clientInitial As String

Dim reportNumberText As String

reportNumberText = Me!SampleNumber.Value
Debug.Print "reportNumberText = " & reportNumberText

Debug.Print "CollectedBy Index: " & Me!Collected_By & " Employee Name: " & DLookup("CollectedBy", "Data_Lookup", Me.Collected_By)


Dim whereString As String
whereString = "SampleNumber=" & "'" & reportNumberText & "'"
Debug.Print whereString
On Error GoTo errorHandling
DoCmd.OpenReport "ECOLI_Laboratory_Report", acViewPreview, , whereString
DoCmd.PrintOut
DoCmd.Close acReport, "ECOLI_Laboratory_Report", acSaveNo

Dim eventsOpen As Integer
eventsOpen = DoEvents()
Debug.Print "Number of Open Events = " & DoEvents()

    Dim PauseTime, Start, Finish, TotalTime

        PauseTime = 10    ' Set duration.
        Start = Timer    ' Set start time.
        Do While Timer < Start + PauseTime
            DoEvents    ' Yield to other processes.
        Loop
        Finish = Timer    ' Set end time.
        TotalTime = Finish - Start  ' Calculate total time.
    myResponse = MsgBox("Processing Report Took " & TotalTime & " seconds.", vbOKOnly)


myResponse = MsgBox("Do you want to add more data?", vbYesNo, "What Next?")


If myResponse = vbYes Then

    DoCmd.Close acForm, "ECOLI_Data", acSaveYes 

Error Generated By Line Above and occurs whether response Y or N to MsgBox.

    DoCmd.OpenForm "ECOLI_Data", acNormal, , , acFormAdd
    DoCmd.GoToRecord , , acNewRec
Else
    DoCmd.Close acForm, "ECOLI_Data", acSaveYes

End If
Exit Sub

 errorHandling:
 If Err.Number = 2501 Then
   myResponse = MsgBox("Printing Job Cancelled", vbOkayOnly, "Report Not Printed")
ElseIf Err.Number = 0 Then
   'Do nothing
Else
   Debug.Print "Error Number: " & Err.Number & ": " & Err.Description

   myResponse = MsgBox("An Error occurred: " & Err.Description, vbOKOnly, "Error #" & Err.Number)
End If


If Application.CurrentProject.AllForms("ECOLI_Data").IsLoaded Then DoCmd.Close acForm, "ECOLI_Data", acSaveNo

If Application.CurrentProject.AllReports("ECOLI_Laboratory_Report").IsLoaded     Then DoCmd.Close acReport, "ECOLI_Laboratory_Report", acSaveNo

endOfSub:
End Sub

Any idea on what am I missing here? Thanks.

  • Remove From My Forums
  • Question

  • when I create an ACCESS Command button to print the screen pdf_format «DoCmd.sendobject» or «DoCmd.outputto»  is OK.

    When the pdf creation is initiated by form_timer receive error 2585 «active screen»

    but interrupt with text format is OK

    • Moved by
      Winnie LiangMicrosoft contingent staff
      Monday, January 29, 2018 5:26 AM

All replies

  • Hi,

    This forum focuses on general feature and troubleshooting for Office 2010. I notice that the issue is related to Access product. 

    To better fix the issue, I would help to move the thread to Access forum for more suggestion. Thanks for your understanding.


    Best Regards,
    Winnie Liang


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact
    tnsf@microsoft.com.


    Click
    here to learn more. Visit the dedicated
    forum to share, explore and talk to experts about Microsoft Teams.

  • Hello nesgal,

    >>When the pdf creation is initiated by form_timer receive error 2585 «active screen»

    >>but interrupt with text format is OK

    Did you use code in Form.Timer event? What’s your code? Which line caused this error?

    What do you mean interrupting with text format is OK?

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click «Mark as Answer» the responses that resolved your issue, and to click «Unmark as Answer» if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to
    MSDN Support, feel free to contact MSDNFSF@microsoft.com.

  • Remove From My Forums
  • Question

  • when I create an ACCESS Command button to print the screen pdf_format «DoCmd.sendobject» or «DoCmd.outputto»  is OK.

    When the pdf creation is initiated by form_timer receive error 2585 «active screen»

    but interrupt with text format is OK

    • Moved by
      Winnie LiangMicrosoft contingent staff
      Monday, January 29, 2018 5:26 AM

All replies

  • Hi,

    This forum focuses on general feature and troubleshooting for Office 2010. I notice that the issue is related to Access product. 

    To better fix the issue, I would help to move the thread to Access forum for more suggestion. Thanks for your understanding.


    Best Regards,
    Winnie Liang


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact
    tnsf@microsoft.com.


    Click
    here to learn more. Visit the dedicated
    forum to share, explore and talk to experts about Microsoft Teams.

  • Hello nesgal,

    >>When the pdf creation is initiated by form_timer receive error 2585 «active screen»

    >>but interrupt with text format is OK

    Did you use code in Form.Timer event? What’s your code? Which line caused this error?

    What do you mean interrupting with text format is OK?

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click «Mark as Answer» the responses that resolved your issue, and to click «Unmark as Answer» if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to
    MSDN Support, feel free to contact MSDNFSF@microsoft.com.

  • Remove From My Forums
  • Question

  • when I create an ACCESS Command button to print the screen pdf_format «DoCmd.sendobject» or «DoCmd.outputto»  is OK.

    When the pdf creation is initiated by form_timer receive error 2585 «active screen»

    but interrupt with text format is OK

    • Moved by
      Winnie LiangMicrosoft contingent staff
      Monday, January 29, 2018 5:26 AM

All replies

  • Hi,

    This forum focuses on general feature and troubleshooting for Office 2010. I notice that the issue is related to Access product. 

    To better fix the issue, I would help to move the thread to Access forum for more suggestion. Thanks for your understanding.


    Best Regards,
    Winnie Liang


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact
    tnsf@microsoft.com.


    Click
    here to learn more. Visit the dedicated
    forum to share, explore and talk to experts about Microsoft Teams.

  • Hello nesgal,

    >>When the pdf creation is initiated by form_timer receive error 2585 «active screen»

    >>but interrupt with text format is OK

    Did you use code in Form.Timer event? What’s your code? Which line caused this error?

    What do you mean interrupting with text format is OK?

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click «Mark as Answer» the responses that resolved your issue, and to click «Unmark as Answer» if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to
    MSDN Support, feel free to contact MSDNFSF@microsoft.com.

Понравилась статья? Поделить с друзьями:
  • Ошибка 25541 при установке microsoft office 2010
  • Ошибка 258 ошибка чтения записи данных кеша
  • Ошибка 25531 не удалось открыть xml файл
  • Ошибка 258 виндовс 10
  • Ошибка 255 тврп