Two Combo Boxes from the same table

  • Thread starter Thread starter Jason
  • Start date Start date
J

Jason

Senario: I have a form that I am adding two combo boxes to. The use of these forms is to select a begin period_name and an end period name each of which the values will be placed the record, below is how the table is set up. The combos work fine until I set the default value to "Format(Date(),"mmmm yyyy")", the default is set up to ease the selection of the date for the user.

tbl_Period PERIOD_NAME PERIOD_BEGIN_DATE PERIOD_END_DATE
August 2004 8/1/2004 8/31/2004
September 2004 9/1/2004 9/30/2004


Problem: When I set the default values on both combo's only the begin period combo populates with the default value, the end period remains blank. In addition if I select a different date from the begin period, the form refreshes both boxes and insert values into the record. For example the begin period shows September 2004 and the end period is blank. If I choose a different begin period it will update both the begin date and the end date. Typically the end date will default to the current month.

The currious thought is that if I change the bound column on the end period from 3 to 2, the default value populates.

Below is the sql for the row source:
SELECT tbl_Period.PERIOD_NAME, tbl_Period.PERIOD_BEGIN_DATE, tbl_Period.PERIOD_END_DATE
FROM tbl_Period;

Desired Result: for both the begin period and end periond combo boxes to display the current month and year

Thanks in advance
Jason
 
Jason

Look into the Format property -- you can tell Access to display a date as
"mmmm, yyyy" to get something like "August, 2004" from 8/3/2004.
 
Thanks Jeff,

I get the desired date format, the problem is described below:

Problem: When I set the default values on both combo's only the begin period
combo populates with the default value, the end period remains blank. In
addition if I select a different date from the begin period, the form
refreshes both boxes and insert values into the record. For example the
begin period shows September 2004 and the end period is blank. If I choose
a different begin period it will update both the begin date and the end
date. Typically the end date will default to the current month.

The currious thought is that if I change the bound column on the end period
from 3 to 2, the default value populates.

Desired Result: for both the begin period and end period combo boxes to
display the current month and year

Thanks
Jason
 
Jason

I guess I'm still somewhat unclear what you are trying to accomplish.
You've described HOW you are trying to do something, but I don't have a
clear sense of WHY.

For the record, combo boxes are for selecting data from a list. If you are
trying to do data entry into one, maybe you need to be using a text control
instead?
 
Jeff,

Sorry for the confusion,

The situation is I have two combo boxes on a form for begin and end date.
The begin should always indicate the first of the month and the end should
be the end date of the month. I was using a text box for these fields but
the users would enter dates other that first of the month and end of the
month. To alliviate the problem I came up with a table that gave a period
for example August 2004. If the user chose August 2004 for the begin date
it would result in an entry into the begin date field of the form data table
of 8/1/2004. In the same respect if the user chose August 2004 in the end
date field it would result in an entry into the end date field of the form
data table of 8/30/2004.

Thanks for your help

Jason
 
Back
Top