AutoFill-Ins Date

  • Thread starter ILoveAccess via AccessMonster.com
  • Start date
I

ILoveAccess via AccessMonster.com

I have to record when my salesman returned their sales leads to me and if
they are on time. Here is how I have everything set up right now...

frmLeads
DateEntered (autoDate)
DateDue (date)
CustomerCode (text, combobox)
DistribRtnDate (date)
DistribOnTime (checkbox)
HouseRtnDate (date)
HouseRtnDate (checkbox)

subformHistory
HistoryDate (autodate)
LeadSource (text)


When I start a new record in frmLeads, the "DateEntered" automatically enters
the current date.
***Here is what I need to happen****

1.) "DateDue" to automatically be 14 days later than the "DateEntered".

2.) Every time "CustomerCode" is changed, the "DateEntered" changes to the
current date.

3.) When "LeadSource" = RBM LR or CSFR LR then the "HistoryDate"
automatically appears in "HouseRtnDate"

When "LeadSource" = Distrib LR then the "HistoryDate" automatically
appears in "DistribRtnDate"

4.)If the "HouseRtnDate" or "DistribRtnDate" are within 14 days of the
"DateDue", then check the box for either "DistribOnTime" or "HouseOnTime"

Thanks!
 
M

Marshall Barton

ILoveAccess said:
I have to record when my salesman returned their sales leads to me and if
they are on time. Here is how I have everything set up right now...

frmLeads
DateEntered (autoDate)
DateDue (date)
CustomerCode (text, combobox)
DistribRtnDate (date)
DistribOnTime (checkbox)
HouseRtnDate (date)
HouseRtnDate (checkbox)

subformHistory
HistoryDate (autodate)
LeadSource (text)


When I start a new record in frmLeads, the "DateEntered" automatically enters
the current date.
***Here is what I need to happen****

1.) "DateDue" to automatically be 14 days later than the "DateEntered".

2.) Every time "CustomerCode" is changed, the "DateEntered" changes to the
current date.

3.) When "LeadSource" = RBM LR or CSFR LR then the "HistoryDate"
automatically appears in "HouseRtnDate"

When "LeadSource" = Distrib LR then the "HistoryDate" automatically
appears in "DistribRtnDate"

4.)If the "HouseRtnDate" or "DistribRtnDate" are within 14 days of the
"DateDue", then check the box for either "DistribOnTime" or "HouseOnTime"


Set the DateEntered text box's DefaultValue property to:
Date()

Set the DateDue text box's DefaultValue property to:
Date() + 14

Use code in the CustomerCode control's AfterUpdate event
procedure to (re)set the DateEntered text box's value:
Me.[DateEntered] = Date
and if you want to (re) set the DateDue as well, add another
line:
Me.DateDue = Date + 14

Similarly, use the LeadSource control's AfterUpdate event to
set HistoryDate:
Select Case LeadSource
Case "RBM LR", "CSFR LR"
Me.HouseRtnDate = Me.HistoryDate
Case "Distrib LR"
Me.DistribRtnDate = Me.HistoryDate
End Select
If HistoryDate might be set after LeadSource, then the above
won't be effective. In this case the above code should
probably be in the HistoryDate control's AfterUpdate event
as well.

To check DistribOnTime or HouseOnTime, use code either in
the form's BeforeUpdate event or HouseRtnDate and
DistribRtnDate Control's AfterUpdate event procedure as well
as after the End Select statement above:

If DateDiff("d", Me.HouseRtnDate, DateDue) < 14 Then
Me.HouseOnTime = True
ElseIf DateDiff("d", Me.DistribRtnDate, DateDue) < 14 Then
Me.DistribOnTime = True
End If
 

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