I have a one to many relationship between a customers table and a servers table. I have a customer form with a server subform. I added a oncurrent event procedure to the servers subform. It seems for some reason the oncurrent code I have or any on current code causes a problem when I delete the customer (with cascading delete). It says unable to update record locked. If I remove the oncurrent event I do not have the problem. Any ideas.
Here is the code:
Private Sub Form_Current()
If ([domain controller].Value = True) Then
optOBDC.Enabled = True
optOPDC.Enabled = True
End If
If ([domain controller] = False) Then
optOBDC.Enabled = False
optOBDC.Value = False
optOPDC.Enabled = False
optOPDC.Value = False
End If
If Me.NewRecord Then
Me.lblRecordNumber.Caption = "New"
Else
Me.lblRecordNumber.Caption = Me.CurrentRecord
End If
End Sub
Here is the code:
Private Sub Form_Current()
If ([domain controller].Value = True) Then
optOBDC.Enabled = True
optOPDC.Enabled = True
End If
If ([domain controller] = False) Then
optOBDC.Enabled = False
optOBDC.Value = False
optOPDC.Enabled = False
optOPDC.Value = False
End If
If Me.NewRecord Then
Me.lblRecordNumber.Caption = "New"
Else
Me.lblRecordNumber.Caption = Me.CurrentRecord
End If
End Sub