Want text or combo box to display a date, but also send it to tabl

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to create a form where you enter the start date into a text box
and it automatically fills in the date of several other text or combo boxes.
The problem is I can't seem to get that date to appear in a table because I
put the formula to generate the date in the ControlSource property. Please
help soon... I have been working on this one thing for quite awhile.
 
Allen,

Thank you for your effort, but I still need help. I haven't used Access
very long so I really just need someone to tell me how to do this.
 
Okay, here's an example. When the user enters the InvoiceDate, you want the
DueDate to default to 30 days later.

Set the ControlSource for the DueDate text box to the name of the field
where you want the value stored--DueDate in this case.

Set the AfterUpdate property of the InvoiceDate text box to:
[Event Procedure]
Then click the Build button (...) beside this.
Access opens the Code window.
Between the "Private Sub..." and "End Sub" lines, enter this line:

Private Sub InvoiceDate_AfterUpdate()
Me.[DueDate] = DateAdd("d", 30, Me.[InvoiceDate])
End Sub


If there are several other dates to set, you will have several similar lines
in the Sub. If one date box depends on several others, you will set its
value in several routines.
 
Allen Browne,

Thank you so much for your help, works like a charm! I would have never
figured that out on my own and I have been trying for a good week!

Thanks again,

Tandy

Allen Browne said:
Okay, here's an example. When the user enters the InvoiceDate, you want the
DueDate to default to 30 days later.

Set the ControlSource for the DueDate text box to the name of the field
where you want the value stored--DueDate in this case.

Set the AfterUpdate property of the InvoiceDate text box to:
[Event Procedure]
Then click the Build button (...) beside this.
Access opens the Code window.
Between the "Private Sub..." and "End Sub" lines, enter this line:

Private Sub InvoiceDate_AfterUpdate()
Me.[DueDate] = DateAdd("d", 30, Me.[InvoiceDate])
End Sub


If there are several other dates to set, you will have several similar lines
in the Sub. If one date box depends on several others, you will set its
value in several routines.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Tandy said:
Allen,

Thank you for your effort, but I still need help. I haven't used
Access
very long so I really just need someone to tell me how to do this.
 
Back
Top