How to use lookup query via database and pre-populate the form fields?