Ok, here goes.

The following code has given me trouble since day one.  That is why I took a 
break for a year as I couldn't figure it out.

dim rs, lineset as RecordSet
dim appointmentNumber as string
  
  // Display Selected Data in Fields
  if me.ListIndex > -1 then
    
    appointmentNumber = AppointmentList.Cell(AppointmentList.ListIndex, 0)
    
    // Get Patient Number for Appointments, then Select ALL Appointments for 
ListBox from CELL selected.
    rs = App.PatientDB.SQLSelect("SELECT * FROM Appointments WHERE 
PatientNumber = '" + pStatNumber.Text + "'")
    lineset = App.PatientDB.SQLSelect("SELECT * FROM Appointments WHERE 
LineItemID = '" + appointmentNumber + "'")

    // Display Data
    if rs <> nil or lineset <> nil then
      
      'appNumber.text = str(rs.Field("LineItemID").IntegerValue)
      'appStatus = rs.Field("AppointmentStatus").StringValue
      'appDate.Text = rs.Field("AppointmentDate").StringValue
      'appDay.Text = rs.Field("AppointmentDay").StringValue
      'appTime.Text = rs.Field("AppointmentTime").StringValue
      'appSpecialist.Text = rs.Field("AppointmentSpecialist").StringValue
      'appReason1.Text = rs.Field("AppointmentReason1").StringValue
      'appNew.Value = rs.Field("AppointmentNew").BooleanValue
      'appMissed.Value = rs.Field("AppointmentMissed").BooleanValue
      'appReset.Value = rs.Field("AppointmentReset").BooleanValue
      'appCompleted.Value = rs.Field("AppointmentCompleted").BooleanValue
      'appReason2.Text = rs.Field("AppointmentReason2").StringValue
      
      appNumber.text = str(lineset.Field("LineItemID").IntegerValue)
      appStatus = lineset.Field("AppointmentStatus").StringValue
      appDate.Text = lineset.Field("AppointmentDate").StringValue
      appDay.Text = lineset.Field("AppointmentDay").StringValue
      appTime.Text = lineset.Field("AppointmentTime").StringValue
      appSpecialist.Text = lineset.Field("AppointmentSpecialist").StringValue
      appReason1.Text = lineset.Field("AppointmentReason1").StringValue
      appNew.Value = lineset.Field("AppointmentNew").BooleanValue
      appMissed.Value = lineset.Field("AppointmentMissed").BooleanValue
      appReset.Value = lineset.Field("AppointmentReset").BooleanValue
      appCompleted.Value = lineset.Field("AppointmentCompleted").BooleanValue
      appReason2.Text = lineset.Field("AppointmentReason2").StringValue
 
    end
    
end if


rs - is to get the correct patient number to find the patient appointments.
lineset - is to get the correct appointment from the patient appointment db.
appointmentNumber - is the appointment listbox CELL in which the appointment is 
in to view or edit.

If I use the .rs there is nothing when I click on the listbox cell for that 
patient appointments.  If I use the lineset, when I click on the ANY of the 
patients appointments the FIRST appointment ONLY shows in the editfields.  So I 
am stuck.  Oh another thing is that I made the appNumber.text visible so I can 
see what number is coming up... It's always the same for the .lineset: -1 and 
for the .rs there is nothing.  I need this code as there are 5 other options 
like this in the program, Contacts, Medications, Physicians and Medical 
Conditions.  They all now have a Listbox to show the BASICS and then when you 
click on the item it all shows up in the editfields below the listbox window.  
NOTE:  The list box just shows the basic item as name, number and what ever... 
the rest of the info will show up in the editfields which may have 20 to 30 
more fields, this is very powerful program as its made to combine many of my 
other software into ONE application.

Help!  


Jonathon
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.407 / Virus Database: 268.12.12/461 - Release Date: 10/2/2006
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to