After date entered, prefill another date field

  • Thread starter Thread starter Stockwell43
  • Start date Start date
S

Stockwell43

Hello,

I was wondering if anyone knows how to get one field to populate the same
datainto another field? In other words:

I have a date field "Funding Date" and when the user enters the funding
date, I want the txtDateFrom1 field to automatically populate with the same
date so the user doesn't have to enter it twice. If possible, please let me
know and also, please simplify answer.

Thanks!!!
 
Use the After Update event of the Funding Date control:

Me.txtDateFrom1 = Me.FundingDate
 
Not really sure why you'd want the same data entered twice in a record (goes
against the rules, unless the second date sometimes needs to be changed
manually) but

Private Sub Funding_Date_AfterUpdate()
Me.txtDateFrom1 = Me.Funding_Date
End Sub

should work! Notice that your control ***Funding Date*** shouldn't have a
space in it, no object names should! But when referring to objects that do
have a space in their name, Access inserts an underline character. If you
were to change the name to FundingDate, the code would be

Private Sub FundingDate_AfterUpdate()
Me.txtDateFrom1 = Me.FundingDate
End Sub

Hello,

I was wondering if anyone knows how to get one field to populate the same
datainto another field? In other words:

I have a date field "Funding Date" and when the user enters the funding
date, I want the txtDateFrom1 field to automatically populate with the same
date so the user doesn't have to enter it twice. If possible, please let me
know and also, please simplify answer.

Thanks!!!

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
 
Worked like a charm!

Thank you!!

Linq Adams via AccessMonster.com said:
Not really sure why you'd want the same data entered twice in a record (goes
against the rules, unless the second date sometimes needs to be changed
manually) but

Private Sub Funding_Date_AfterUpdate()
Me.txtDateFrom1 = Me.Funding_Date
End Sub

should work! Notice that your control ***Funding Date*** shouldn't have a
space in it, no object names should! But when referring to objects that do
have a space in their name, Access inserts an underline character. If you
were to change the name to FundingDate, the code would be

Private Sub FundingDate_AfterUpdate()
Me.txtDateFrom1 = Me.FundingDate
End Sub



--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
 
Back
Top