Ah... OK.
> Option Compare Database
This is an option for the entire module. It doesn't matter what it does, it has no effect on the code below.
> Option Explicit
This option makes it mandatory to declare all variables. You can't just write "A=2", you need to "create" the variable A before using it.
> Private Sub txtOrderNo_AfterUpdate()
This is the header of an event procedure. The form has a text box called txtOrderNo, and "after updat[ing]" the text box, this piece of code is run.
> Dim strCriteria As String
The code will need a variable, called strCriteria, holding textual information. A 'String' (short for 'string of characters') is basically text. This line would not be required without 'Option Explicit' at the top of the module.
> If IsNull(txtOrderNo) Then
This tests whether there is a value in the text box.
> txtQuery = Null
If there isn't, we don't want to show anything, so the other text box, txtQuery, is set to Null (meaning blank).
> Else
Other possible outcome of the test: there is something in the text box
> strCriteria = txtOrderNo
Copy the information into the variable strCriteria
> strCriteria = Replace(strCriteria, " ", " ")
Find all double spaces, replace them with single spaces. This avoids a possible error.
> strCriteria = Replace(strCriteria, " ", ",")
Replace remaining spaces with a comma.
> strCriteria = "ORDER_NO In (" & strCriteria & ")"
The criteria now reads for example: ORDER_NO In(7,11)
> txtQuery = "... WHERE " & strCriteria
Writes "... WHERE " and the criteria into the text box txtQuery
> End If
End of the condition evaluation.
> End Sub
End of the subroutine, or the "event handler".
There you go.
(°v°)