All of the controls in the if statement are form controls they are unbound cont fields
From what I can gather, you are just trying to write a bit of status text depending on some conditions. If this were me I would write a sub containing a few If and/or Select statements to check all of your conditions and have the form call that sub after it opens / changes. It would write its result to a Label on the form, not a textbox.
For three reasons really,
1, It is much easier to read code when it is indented and commented (not only to others but for yourself months/years later).
2, So that you can debug it in the VB window when you call it (by clicking in the margin next to the sub name, a burgundy dot will be placed there signifying that the next time you run it it will open the VB window and you can step through the code using F8, checking your logic and flow control. Also if you hover over a variable, it will show you its contents (after it has been parsed). You can also type commands directly into the Immediate Window as afurther tool.
3. Error Handling.
If all of the controls you are trying to check are on the form, reference them like
- Dim somevariable As String
-
-
somevariable = Me.SomeControl.Value
-
-
If somevariable = "somestatus" then
-
Do something
-
Else
-
Do something else
-
End If
Then update the label like
- Me.LabelStatus.Value = somevalue
Gaz