全レコードを削除
Dim strSQL As String
DoCmd.SetWarnings False
strSQL = "DELETE * FROM [[テーブル]]名"
DoCmd.RunSQL strSQL
空白行削除
Private Sub Form_AfterUpdate()
If IsNull(Me.[[テキストボックス]].Value) Then
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.SetWarnings True
End If
End Sub
カレントレコードの背景色(帳票フォーム)
非連結テキストボックス[txtID]作成、フォームヘッダーに置く
条件書式 式:[txtID]=[ID]
Private Sub Form_Current()
Me.txtID = Me.ID
End Sub
空白がある時、次のレコードに移動させない
Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNull(Me.A) Or IsNull(Me.B) Or IsNull(Me.C) Then
MsgBox "未入力があります"
Cancel = True
End If
End Sub
最終更新:2011年10月19日 10:41