Combo Box selection limited by value in text box

Combo Box selection limited by value in text box

Post by cmljaGFyZG » Wed, 28 Dec 2005 12:04:02


I want a combo box on my form to select an appointment within a date range
that I enter into text boxes txtDateHigh and txtDateLow on my form. The combo
box row source is like:

SELECT Patient, ApptDate, ApptTime WHERE ApptDate Between [txtDateLow] And
[txtDateHigh];

Problem is, when I change the dates in txtDateHigh and txtDateLow, the combo
box selection does not refresh. The selected range stays as it was. Is there
a better method for this? Thank you.
 
 
 

Combo Box selection limited by value in text box

Post by tina » Wed, 28 Dec 2005 12:18:13

you need to "re-run" the combo box's RowSource query to apply the new date
parameters. in the AfterUpdate events of txtDateHigh and txtDateLow, add the
following code, as

Me!ComboBoxName.Requery

or, instead, you could add the code to the combobox's Enter event.

hth




combo
combo
there

 
 
 

Combo Box selection limited by value in text box

Post by cmljaGFyZG » Wed, 28 Dec 2005 12:55:02

Thank you tina. I had actually tried doing a Requery on the ENTER or CLICK
events of the combo box, and it didn't work. However, using what you
suggested on the After Update events of txtDateHigh and txtDateLow did the
job. Thanks again...