subform

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

Guest

I have a call log subform that lists the Customer ID, Contact Date, Comments,
and a Projected Follow up Date.

Is there a way so that when a date is entered into the Follow Up Date column
a new record is automatically started and puts the date in the Contact Date
column?

thanks
 
Sure, but is there a reason you don't want to wait until that date (or some
subsequent date) to actually insert that record? What if you never actually
make the callback, you will have a record with no information in it. If you
are concerned about that, you could write a query to identify all the records
that have a [FollowupDate] but which don't have records for that date or
later.

The way to do what you asked would be in the AfterUpdate event of the
[FollowupDate] control, and would look something like:

Private sub txt_FollowupDate_AfterUpdate

'if there is no value, don't do anything
if LEN(me.txt_FollowupDate & "") = 0 then Exit Sub

Dim strSQL as string
strSQL = "INSERT INTO yourTable (Customer_ID, Contact_Date) " _
& "Values (" & me.txt_CustomerID & ", " _
& "#" & me.txt_FollupDate & "#")
currentdb.execute strsql

End Sub
 
Back
Top