Limit combo box selection based on a value in another column

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

To simplify, say my form shows records in tblPatientEncounters and it has two
columns: txtPatUniqueID and txtEpisodeNumber. There are multiple Episodes for
each patient and they are stored in tblPatEpisode. I want the user to be able
to change the value of of txtEpisodeNumber by selecting from tblPatEpisode,
but only "see" the Episodes corresponding to the txtPatUniqueID for the
display line that she is working on. I replaced txtEpisodeNumber on the form
with cboEpisodeNumber with a SELECT statement having a WHERE clause that
limits by txtPatUniqueID. The problem is that the first selected row works,
but when I then select another row and try my combo box, the WHERE limitation
remains as for the first row I selected. I've tried replacing the SELECT
statement with reference to a query that limits by txtPatUniqueID in the
form, but get the same problem.

I think a summary would be that I am stumped trying to make a combo box
selection on a row in a form where the selection is limited by a field in the
selected row.

Any ideas? Thank you.
 
Hi Rick,

This was not a list box to list box, or combo to sub combo. The form is
reading records directly from a table. However, I studied the examples you
pointed me to and was convinced that I had coded pretty much like the
samples. So, I tried adding a refresh records to the click and enter events
of my combo box, and that fixed the problem. Now my combo accurately shows
columns related to the selected record. Many thanks...Richard
 
Back
Top