default Date value

L

Liz Hansen

Hello,

I have a form which 2 date fields. The user will either type in a date or
select a date from a calendar.

I was hoping I could put something in the "After Update" event on this field
to automatically populate the second field like such:

If the user types in 01/01/03 the automatic default date in the second field
should be 01/01/04 (one year later).

Is this possible?

Thanks,

Liz
 
R

Rick Brandt

Liz Hansen said:
Hello,

I have a form which 2 date fields. The user will either type in a date or
select a date from a calendar.

I was hoping I could put something in the "After Update" event on this field
to automatically populate the second field like such:

If the user types in 01/01/03 the automatic default date in the second field
should be 01/01/04 (one year later).

In the AfterUpdate event of the first date TextBox...

Me.SecondTextBoxName = DateAdd("yyyy", 1, Me.FirstTextBoxName)
 
L

Liz Hansen

Works great!

Thanks,


Rick Brandt said:
In the AfterUpdate event of the first date TextBox...

Me.SecondTextBoxName = DateAdd("yyyy", 1, Me.FirstTextBoxName)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top