Follow-up field

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

Guest

Hi, I'm using Access XP.

I have a field called Follow-up which needs to store either 1 Hour, 3 Hours,
1 Day, 1 Week, 1 Month or 3 Months. I will set up a combo box to give the
user these choices, but I can't figure out what data type to use - I see
Date/Time, and the Short Time format which would work for the first 2, but
what about the day and months? This needs to be a real time period vs. text,
because later we will want to run calculations on this data. Any help is
appreciated. thank you.
 
Use 2 fields: one for the number, and one for the period type.

For the period type, use a combo box that has these properties:
Row Source Type Value List
Row Source "d", "days", "m", "months", "yyyy", "years"
Bound Column 1
Column Count 2
Column Widths 0

The followup date is then given by this expression:
=DateAdd([PeriodType], [HowMany], [OriginalDate])
substituting your actual field names in the square brackets.
 
THANKS! I will try this. I would have NEVER thought of this, thanks for
your help.

Allen Browne said:
Use 2 fields: one for the number, and one for the period type.

For the period type, use a combo box that has these properties:
Row Source Type Value List
Row Source "d", "days", "m", "months", "yyyy", "years"
Bound Column 1
Column Count 2
Column Widths 0

The followup date is then given by this expression:
=DateAdd([PeriodType], [HowMany], [OriginalDate])
substituting your actual field names in the square brackets.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Angie M. said:
Hi, I'm using Access XP.

I have a field called Follow-up which needs to store either 1 Hour, 3
Hours,
1 Day, 1 Week, 1 Month or 3 Months. I will set up a combo box to give the
user these choices, but I can't figure out what data type to use - I see
Date/Time, and the Short Time format which would work for the first 2, but
what about the day and months? This needs to be a real time period vs.
text,
because later we will want to run calculations on this data. Any help is
appreciated. thank you.
 
Back
Top