The Inquiry form is completely generic, generating lookups from table relations. If you want a custom lookup, add a field to your dialog (in the same way as Log Number field), override lookup method and implement your logic there. Then take value and add it as a range to the query at runtime.