After date entered, prefill another date field

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!!!
 
K

Klatuu

Use the After Update event of the Funding Date control:

Me.txtDateFrom1 = Me.FundingDate
 
L

Linq Adams via AccessMonster.com

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
 
S

Stockwell43

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
 

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