R
rocco
Hello,
this is driving me crazy...
I have a combox which lists all the visit patients have done during a week.
Each patient can come twice but mostly they come once.
Each patient has an ID which is a number and two letters.
A combobox will allow me to retrieve info for the visits patients have done.
The combobox has two column: the first one list the patient ID and it is the
bound one; the second list the data of the visit.
Trouble comes when a patient comes twice. let's think to patient coded :1TO
who had two visits first on 7/29/2006 and second on 7/30/2006. My combo will
list someting like:
1TO | 7/29/06
1TO | 7/30/06
I would like to retrive the info for each visit using the value for the
second column to build a filter but...
If i try to select 1TO | 7/30/06 in the combo, it comes up with the data
for the 7/29/06 visit!!!
It seems like I'm not selecting the second row, but always the first
one!This is the portion of code I'm using to retrieve the info and
re-populate the unbound form:
rst.Open "SELECT * FROM " & TABL.Name & " WHERE ID='" &
Forms(ff.Name).Controls("FINDVISIT").Value & "' AND VISITDATE=#" &
Forms(ff.Name).Controls("FINDVISIT").Column(1) & "#",
CurrentProject.Connection, adOpenStatic, adLockReadOnly
For i = 0 To rst.Fields.Count - 4
Forms(ff.Name).Section(acDetail).Controls(rst.Fields(i).Name).Value =
rst.Fields(i)
Next i
rst.Close
thanks folks,
Rocco
this is driving me crazy...
I have a combox which lists all the visit patients have done during a week.
Each patient can come twice but mostly they come once.
Each patient has an ID which is a number and two letters.
A combobox will allow me to retrieve info for the visits patients have done.
The combobox has two column: the first one list the patient ID and it is the
bound one; the second list the data of the visit.
Trouble comes when a patient comes twice. let's think to patient coded :1TO
who had two visits first on 7/29/2006 and second on 7/30/2006. My combo will
list someting like:
1TO | 7/29/06
1TO | 7/30/06
I would like to retrive the info for each visit using the value for the
second column to build a filter but...
If i try to select 1TO | 7/30/06 in the combo, it comes up with the data
for the 7/29/06 visit!!!
It seems like I'm not selecting the second row, but always the first
one!This is the portion of code I'm using to retrieve the info and
re-populate the unbound form:
rst.Open "SELECT * FROM " & TABL.Name & " WHERE ID='" &
Forms(ff.Name).Controls("FINDVISIT").Value & "' AND VISITDATE=#" &
Forms(ff.Name).Controls("FINDVISIT").Column(1) & "#",
CurrentProject.Connection, adOpenStatic, adLockReadOnly
For i = 0 To rst.Fields.Count - 4
Forms(ff.Name).Section(acDetail).Controls(rst.Fields(i).Name).Value =
rst.Fields(i)
Next i
rst.Close
thanks folks,
Rocco