It appears that the text box control name is the same as the bound field. Sometimes the Access gnomes get obstinate - you should not have the control name the same as the bound field. Try renaming the text box to "tbEventNumber" (tb = text box).
This is how I might write the sub (if Event number is a number):
Code:
Private Sub Command17_Click() '<<-- Command17 is a poor name.... just saying
Dim strSource As String
Dim intEventNum As Integer
'get event number from form
intEventNum = Val(Trim(Me.tbEventNumber & "")) '<<-- Note text box name!
strSource = "SELECT [TblAllEvents].[Badge], [TblAllEvents].[EventNumber], [TblAllEvents].[FirstName], [TblAllEvents].[LastName], [TblAllEvents].[Attendees]"
strSource = strSource & " FROM [TblAllEvents]"
If Nz(intEventNum, 0) > 0 Then
strSource = strSource & " WHERE TblAllEvents.EventNumber = " & intEventNum
Debug.Print strSource '<< comment out when debugging is complete
Me.LstVolunteers.RowSource = strSource
Me.LstVolunteers.Requery
Else
MsgBox "Missing value or Error in control 'tbEventNumber'"
End If
End Sub
To check the generated SQL, you can copy the SQL from the immediate window, create a new query, switch to SQL view, paste in the copied SQL and execute the query.