using a form to search for records over odbc connection..

L

Lee Taylor-Vaughan

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


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
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
 
L

Lee Taylor-Vaughan

I forgot to add the "status" field in the SQL statement it is:
tblPatients.QAStatus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top