Frontend Access 2010, backend SQL Server 2008:
I have a Problem which I cannot solve at all.
  
on a form there are 3 subforms which get their records through 3 passthrough queries from the Server.
  
All 3 subforms have the same Settings like AllowDeletions, allow Edits,Lockings, etc. All are Snapshots. All tables have PK's.
From all connected tables I can delete (add, edit) records directly in the tables.
  
On one of the 3 Subforms I can delete a selected record with this code
  
 
	
	
	
		
 
On the other 2 subforms the code does not even start when pressing the DELETE Key, the Status bar say "Cannot delete record".
  
when I use the code on the Main form refering to the fields in the subform it works also for the 2 subforms.
  
Thanks your help.
Michael
 I have a Problem which I cannot solve at all.
on a form there are 3 subforms which get their records through 3 passthrough queries from the Server.
All 3 subforms have the same Settings like AllowDeletions, allow Edits,Lockings, etc. All are Snapshots. All tables have PK's.
From all connected tables I can delete (add, edit) records directly in the tables.
On one of the 3 Subforms I can delete a selected record with this code
		Code:
	
	
	 Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Dim strsql As String
 
 If KeyCode = 46 Then  'KeyCode = 46 ..DELETE Key
    If MsgBox("Delete?", vbYesNo + vbQuestion, "Security question") = vbYes Then
    strsql = "Delete from dbo.tblAusbildungPersonal where MaID= " & Me.Parent.MaID & " and AusbildungsID= " & Me.AusbildungsID
    
    Call SQL_PassThrough(strsql)
    End If
 End If
 Me.Requery
 
 End SubOn the other 2 subforms the code does not even start when pressing the DELETE Key, the Status bar say "Cannot delete record".
when I use the code on the Main form refering to the fields in the subform it works also for the 2 subforms.
Thanks your help.
Michael
 
	 
 
		 
 
		 
 
		 
 
		