Combo query (1 Viewer)

mattP

Registered User.
Local time
Today, 12:34
Joined
Jun 21, 2004
Messages
87
Ok I think this is going to be a really easy answer for someone but I'm going round in circles :confused:

I have a table, called "TBL_QUARTER"
It has 3 columns, as follows:

Quarter
Startdate
Enddate


I have a form that is bound to the table, which has a combo box which is using Quarter as it's row source and two text boxes, one bound to startdate and one bound to enddate.

So all I want this to do is, when I change the Quarter chosen in the combo box, the startdate and enddate update accordingly.

It works using the record navigation "goto next record" etc...

On the Combobox, on the afterupdate event, I have tried to requery the textboxes but to no avail.

Can anyone point me in the right direction ?

many thanks

MattP
 

RuralGuy

AWF VIP
Local time
Today, 05:34
Joined
Jul 2, 2005
Messages
13,825
Use the wizard to add a ComboBox that will "Find a record on my form based on a value I selected in my combo box".
 

mattP

Registered User.
Local time
Today, 12:34
Joined
Jun 21, 2004
Messages
87
Ruralguy,

Not sure what you mean, I have a combo box on the form now, which shows the first column only, whoch has the QTR values in there ie. FY06 Q1, FY06 Q2 etc

When I select a value from the drop down I want to get teh corresponding 2 columns to populate, or update two textboxes as below:

Quarter StartDate EndDate
FY06 - Q1 29/01/2005 29/04/2005
FY06 - Q2 30/04/2005 29/07/2005
FY06 - Q3 30/07/2005 28/10/2005
FY06 - Q4 29/10/2005 03/02/2006
FY07 - Q1 04/02/2006 05/05/2006
FY07 - Q2 06/05/2006 04/08/2006
FY07 - Q3 05/08/2006 03/11/2006
FY07 - Q4 04/11/2006 02/02/2007



So if I choose FY06 Q1 then textbox1 fills with 29/01/2005 and textbox2 with 29/04/2005 ?

Hope that makes sense ?

MattP
 

RuralGuy

AWF VIP
Local time
Today, 05:34
Joined
Jul 2, 2005
Messages
13,825
Bind your Startdate and EndDate controls to their respective fields in the underlying table and then add the ComboBox as I suggested. If it works then delete your first ComboBox.
 

Users who are viewing this thread

Top Bottom