If Then relationship with multiple conditions

Anonymous
2022-11-17T09:46:18.427+00:00

Hi everyone, I have the following problem: I have 3 drop-down menus from which a status can be selected. Another field should display "Phase completed" if all three drop-down menus are either "done" or "not necessary". I have now tried to implement this, but with the following code I am not quite right yet. It only shows the change of the first field, regardless of what is entered in the other fields.
I hope somebody could help me.
Thanks a lot,

Greetings Caro

Private Sub Text872_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)  
  
If [Status1] = "done" Or [Status1] = "not necessary" And [Status2] = "done" Or [Status2] = "not necessary" _  
And [Status3] = "done" Or [Status3] = "not necessary" Then  
Text872 = "Phase completed"  
Else: Text872 = "Phase not completed"  
End If  
End Sub  
Access Development
Access Development
Access: A family of Microsoft relational database management systems designed for ease of use.Development: The process of researching, productizing, and refining new or existing technologies.
817 questions
0 comments No comments
{count} votes

Accepted answer
  1. xps350 376 Reputation points
    2022-11-17T12:58:18.473+00:00

    Try it with brackets:

    If ([Status1] = "done" Or [Status1] = "not necessary") And ([Status2] = "done" Or [Status2] = "not necessary") _
    And ([Status3] = "done" Or [Status3] = "not necessary) "


0 additional answers

Sort by: Most helpful