Option Compare Database
Sub CreateMyQuery()
Dim strSQL As Variant
Dim strVal As Variant
Dim myQuery As QueryDef
On Error Resume Next
DoCmd.DeleteObject acQuery, "NewQuery"
strVal = InputBox("Input Value to be found", "?")
strSQL = "Select * from T1 where Field1 =" & strVal & " OR Field2 =" & strVal & " OR Field3 =" & strVal & " OR Field4 =" & strVal & " OR Field5 =" & strVal
Set myQuery = CurrentDb.CreateQueryDef("NewQuery", strSQL)
DoCmd.OpenQuery myQuery.Name
myQuery.Close
Set myQuery = Nothing
End Sub