DateAdd calculation. (1 Viewer)

MaleNurse325

Registered User.
Local time
Today, 03:44
Joined
Jan 11, 2016
Messages
72
Hi guys.
This is something I have done in the past but forgotten how to do it.

So have have an input file with a date. [Conducted]
Next to this a drop down list with a text field that reads 3 months; =6 months, 9 months, 1 year etc in the same table from whence those text fields are the source, I have the corresponding number of days. 90, 160, 270 and 365,

In a calculated field on the form I would like to show the date of [Conducted] + the number of days in the drop down box.

I know you can help me
example.png
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:44
Joined
Oct 29, 2018
Messages
21,682
If the combo is bound to the number of days, then you can use something like:

DateAdd("d", ComboName, Conducted)

However, using the number of days won't always be accurate since months have different number of days.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 05:44
Joined
Feb 28, 2001
Messages
27,621
In a combo box, you can have more than one column visible. What you do is widen the box and then have the next column contain the number of days. To make that happen, have a table with "3 months, 90 days" "6 months, 180 days" etc. (as two adjacent fields). Then in the column width property of the combo, include non-zero width for each column you want to see. NOTE that if you want to see the number of days, you have two choices. First is widen the control on the form to accommodate the width of both columns combined. Second, you could have the displayed width (.ListWidth) greater than the control's .Width - which means when you are selecting the width can be wider than when the control is not in focus.
 

Users who are viewing this thread

Top Bottom