Here is an example of a simple one i have used. If you have any questions about any part of the code let me know. Access help file will help shed some light on a few things.
the '+ _ ' in the SQL part allows you to continue the code onto the next line. Helps make things look a little neeter in VBA.
bol
wah
Dim strSQL As String ' Holds SQL statement
If (MsgBox("You can not undo this action. Press OK to proceed with the deletion.", vbOKCancel, "Delete Employee"

) = 1 Then 'Confirms deletion
strSQL = "" + _
"DELETE * " + _
"FROM tblEmployeeDetails " + _
"WHERE ([tblEmployeeDetails].[EmpID] = [Forms]![Main]![MainSubForm].[Form]!EmpID)"
DoCmd.SetWarnings (False) 'Turns the pesky warnings off
DoCmd.RunSQL (strSQL)
DoCmd.SetWarnings (True) 'Turns the pesky warnings on