Display a list 
Author Message
 Display a list
i want to display a list from a query which contain patient list group by
employer and treatment date. employer and treatment date will be input by
user.someone please help me.

   -**** Posted from RemarQ, http://www.***.com/ ****-
 Real Discussions for Real People



Mon, 07 Jan 2002 03:00:00 GMT
 Display a list

I assume that you are treating the query as a recordset.

In you form you should have two text box controls, a button, and a list box.

i.e

The two text box controls
txtEmployer
txtDate

The Button

cmdFillList

the ListBox

lstPatients

I will assume the patient recordset is called

rsPatienRecords

The user should enter in the name of the employer and the date. Then press
the search button

in

private sub cmdFillList_Click()

'Two variables
dim strEmployer as string
dim MyDate as  Date
dim strFilter as string
dim strText as string

strEmployer = txtEmployer.text
MyDate = cDate(txtDate.txt)

    strFiltrer = "Employer = " & strEmployer " AND TreateDate = " & MyDate

    rsPatientRecords.Filter = strFilter

    lstPatients.clear

    'Check for patient records
    if not rsPatientRecords.RecordCount = 0 then
        'If there are patient records
        rsPatientRecords.MoveFirst

        do until rsPatientRecords.EOF

            'I have used a variable to store the information from the
patient
            'Recordset.  This means that you can add extra information to
the         'string before you add it to the list box.

            strText = rsPatientRecords.Fields("PatientName")
            'Add the Patient to the list box
            lstPatients.AddItem strText

        loop

    else

        msgbox("No Patients!", etc)

    end if

end sub

This should work (you will need to add some error checking code ie That the
user entered a proper date etc)

If you are using Visual Basic Version 6. Then you can use the date picker
for the user to enter the date.

Also. you could use a combo box for the user to select employers.

ie.

    rsEmployers

    with rsEmployers

        .Open
        .MoveFirst

        do until .EOF

            'Fill up the combo box with employers
            strEmployer = .Fields("EmployerName")
            cmbEmployer.AddItem strEmployer
            .MoveNext

        loop

in the fill list button

    strEmployer = cmbEmployer.list(cmbEmployer.ListIndex)
    'If you are using the DatePicker
    MyDate = dpDate.Value


Quote:
>i want to display a list from a query which contain patient list group by
>employer and treatment date. employer and treatment date will be input by
>user.someone please help me.

>   -**** Posted from RemarQ, http://www.remarq.com/?b ****-
> Real Discussions for Real People



Mon, 07 Jan 2002 03:00:00 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. How to display value list like HTML list?

2. Displaying a list of found record IDs

3. Displaying text list with link - FMP

4. Display a list of fields in a table

5. Displaying value lists

6. Displaying Value Lists

7. Speed for displaying value list in relational databases

8. Local menu that displays the list records of its current database

9. "Unable to display the list of databases on 'mname'."

10. I can't seem to get my Oracle Linked Server to display the list of tables

11. How to display a list of records with sorting by a special field ???

12. How to display a list of database in Enterprise Manager window?


 
Powered by phpBB® Forum Software