using an unbound form to search odbc/sql and display results on that same form...

using an unbound form to search odbc/sql and display results on that same form...

Post by Lee Taylor » Thu, 02 Dec 2004 01:54:46


Hello,

I have odbc linked tables in my database. I have a form and i have found
that if i bind an odbc data source to the form (with lost of records in it)
it takes forever to open. therefore, i want to be able to place fields on
the form, enter desired data into these fields and click search, and then
form populates with the required data in a list box. (on the same form).

the search fields and type on the form header are:
txtStartDate formated as date/time
txtEndDate formated as date/time
Status x3 radio buttons -'Complete' or 'Incomplete' or 'All'

and then a button cmdSearch

Displayed columns in the list box (in form details):
DispatchID
DispatchDate
DisptachCity
DispatchAddress
LastName
FirstName
Age
ChiefComplaint
Support
QAStatus

sql for list box is as follows: (but now needs to reflect the above search
criteria).

SELECT TblPatients.PatRecID, TblDispatch.DispatchID,
TblDispatch.DispatchDate, TblDispatch.DispatchAddress, TblDispatch.City,
TblPatients.LastName, TblPatients.FirstName, TblPatients.Age,
TblPatients.ChiefComplaint, TblPatients.Support, TblDispatch.DispatchType,
tblPatients.QAStatus
FROM TblDispatch INNER JOIN TblPatients ON TblDispatch.DispatchID =
TblPatients.DispatchID
WHERE (((TblDispatch.DispatchType)="completed als call" Or
(TblDispatch.DispatchType)="released to bls"));

I really need help with how to code the 'search' button when clicked.

Is there a utility out that allows this to be done automatically?

Thanks in advanced

Lee