Set default value in form to value of another field (1 Viewer)

mcinta19

New member
Local time
Today, 13:25
Joined
Jan 16, 2018
Messages
7
I have a database that tracks appointment information. When entering information in my form I would like to have the due dates automatically populate.

I have a field Letter Due Date that I would like to have automatically set to be the date from another field (Date) + 1 month. There is another Due Date field that I would like to have populate for the Date + 2 weeks.

How would I go about doing this?

Thanks.
 

mcinta19

New member
Local time
Today, 13:25
Joined
Jan 16, 2018
Messages
7
I tired adding the DateAdd to the default value but I got an error.
This is what I used. I'm not sure the proper way of referring to the field I am pulling the date from and it's not always today's date so I can't use Date().
=DateAdd(1,"m",[Date])
 

plog

Banishment Pending
Local time
Today, 12:25
Joined
May 11, 2011
Messages
11,611
Did you look at the samples on the link I provided? Your's doesn't conform to those.
 

mcinta19

New member
Local time
Today, 13:25
Joined
Jan 16, 2018
Messages
7
I fixed the code but I still get an error. I cannot add a specific date as in the example because the dates are always different.

=DateAdd("m",1,[Date])
 

plog

Banishment Pending
Local time
Today, 12:25
Joined
May 11, 2011
Messages
11,611
What error are you getting?

In what you have, [Date] is referencing the field from the underlying table of the form. Does that table actually have a field named "Date". If not, change it to the correct date, or you can also reference the name of the input (e.g. Me.DateField) and use it as the date to base your calculation on.
 

mcinta19

New member
Local time
Today, 13:25
Joined
Jan 16, 2018
Messages
7
There is a Date field in the Table. Now I am not getting an error but the field is still not populating.
 

plog

Banishment Pending
Local time
Today, 12:25
Joined
May 11, 2011
Messages
11,611
Then you aren't providing the DateAdd a valid date. Make it so that it is.
 

Users who are viewing this thread

Top Bottom