No, the PK ws not removed, I added more fields to the table. is there a limit to the no of memo field that can be on a table? below is the code that updates the recordset
Private Sub CmdSaveNew_Click()
On Error GoTo Tina
Tina:
If IsNull(ctlName) Then
MsgBox "Please enter your name"
ctlName.SetFocus
ElseIf IsNull(XNAC) Then
MsgBox " Please enter XNAC"
XNAC.SetFocus
ElseIf IsNull(txtDate) Then
MsgBox " Please enter Proposed Close Date"
ElseIf IsNull(txtDateRequested) Then
MsgBox " Please enter Accept Date"
Else
Dim db As Database
Set db = CurrentDb
Dim tblpool As Recordset
Dim Sixtyplus As Integer
Dim rstemp As Recordset
Dim rstemp2 As Recordset
Dim rstemp1 As Recordset
Dim rstemp3 As Recordset
Dim ctl As Control
Set tblpool = db.OpenRecordset("Report_History_Table")
tblpool.AddNew
tblpool![DateModified] = Date
tblpool![Status] = cmbStatus.Value
tblpool![AccountName] = ctlName.Value
tblpool![AssignedTo] = txtAssignedTo.Value
tblpool![AcceptDate] = txtDateRequested.Value
tblpool![ProposedclsDate] = txtDate.Value
tblpool![Escalatedby] = txtElevatedby.Value
tblpool![CustomerContactName] = CustomerContactName.Value
tblpool![CustomerPh] = CustomerPh.Value
tblpool![CustomerEmail] = CustomerEmail.Value
tblpool![Issuecate1] = Issuecate1.Value
tblpool![Issue1Resolved] = chkIssue1Resolved.Value
tblpool![Issue2Resolved] = chkIssue2Resolved.Value
tblpool![Subprocess4] = Subprocess4.Value
tblpool![Prevention1] = Prevention1.Value
If Len(XNAC.Value & "") > 0 Then
tblpool![XNAC] = XNAC.Value
Else
MsgBox " Please enter XNAC"
XNAC.SetFocus
End If
tblpool![Priority] = XNAC2.Value
'New Code
If Len(XNAC2.Value & "") > 0 Then
Set rstemp = db.OpenRecordset("Select sum(invamt) AS [Sixtyplus] from Debits where (XNAC Like '" & [Forms]![Request lookup and update]![XNAC] & "*' or XNAC Like '" & [Forms]![Request lookup and update]![XNAC2] & "*') and INVAMT > 0 and (DateDiff('M',InvDate,Now()))>1")
With rstemp
.MoveFirst
tblpool![SixtyPlus_Acceptdt] = !Sixtyplus
End With
Else
Set rstemp = db.OpenRecordset("Select sum(invamt) AS [Sixtyplus] from Debits where (XNAC Like '" & [Forms]![Request lookup and update]![XNAC] & "*') and INVAMT > 0 and (DateDiff('M',InvDate,Now()))>1")
With rstemp
.MoveFirst
tblpool![SixtyPlus_Acceptdt] = !Sixtyplus
End With
End If
tblpool.Update
Me!ctlName.Requery
MsgBox " Saved"
For Each ctl In Me.Controls
If ctl.ControlType = acTextBox Then
ctl.Value = ""
ElseIf ctl.ControlType = acComboBox Then
ctl.Value = ""
ElseIf ctl.ControlType = acCheckBox Then
ctl.Value = False
ctl.Enabled = True
End If
Next ctl
Set ctl = Nothing
Exit Sub
End If
DoCmd.RunCommand acCmdRefresh
End Sub