One way would be to add a field to your table (name it fldDays) that is
holding the data that your combo box uses. Put appropriate values in that
field for each record so that the number is the number of days to be added
when that item is selected. For example, 7 is the value for 1 week, 21 is
the value for 3 weeks, etc.
Then use a multicolumn combo box that uses this as a query (example) for the
row source:
SELECT fldDays, TimeTermField FROM TableName;
For the combo box's properties:
- set the bound column to 1.
- set the column count to 2.
- set the column widths to 0";1'.
This way, when the user selects the term desired (which will show in the
dropdown list), the combo box's value will be the actual number of days to
be used. Thus, you could use the DateAdd function to get the new date from
today's date:
NewDate = DateAdd("d", Me.ComboBoxName.Value, Date())
This won't be an exact method for "one month".
Another option could be to put two fields in the table, where one field is
the abbreviation in DateAdd for the specific term interval (m for month, d
for day, yyyy for year; the other field would be the number. Then you could
have three columns in the combo box query, and use this query as the Row
Source:
SELECT fldDays, fldInterval, TimeTermField FROM TableName;
For the combo box's properties:
- set the bound column to 1.
- set the column count to 3.
- set the column widths to 0";0";1'.
Then, you could use the DateAdd function to get the new date from today's
date:
NewDate = DateAdd(Me.ComboBoxName.Column(1), Me.ComboBoxName.Value,
Date())