Hi Guys

The following code works fine but now I need to add one more field as below for each record.

SLAdate: this is dependent on the Time Field time. If the Time field time is less than 13:00:00 then the SLAdate should be the same as the Date Field date. If the Time Field time is greater than 13:00:00 then the SLADate should be the Date Field date + 1 day, unless the date field date is a Friday, when it should be the Date Field date + 3 days

Private Sub CommandButton1_Click()
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim r As Long
Set cn = New ADODB.Connection
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & _
        "Data Source=J:\Archive.mdb;"
Set rs = CreateObject("ADODB.Recordset")
rs.Open "tblmain", cn, adOpenKeyset, adLockOptimistic, adCmdTable
 With rs
        .AddNew
        .Fields("Username") = Application.UserName
        .Fields("Date") = Format(Date, "dd/mm/yyyy")
        .Fields("Time") = Format(Time, "hh:mm:ss")
        .Fields("Polno") = TextBox1.Value
        .Fields("Choice") = CommandButton1.Caption
        .fields("SLADate")=?????
        .Update
  End With
   Set rs = Nothing
  Set cn = Nothing
End Sub