Option Compare Database Private Sub Form_Close() On Error GoTo Err_cmdCloseForm_Click DoCmd.RunCommand acCmdSaveRecord DoCmd.Close Exit_cmdCloseForm_Click: Exit Sub Err_cmdCloseForm_Click: MsgBox Err.Description Resume Exit_cmdCloseForm_Click End Sub Private Sub Form_Load() DoCmd.Maximize End Sub Private Sub Kommandoknapp6_Click() Dim cmdstr As String cmdstr = "SELECT Tabell1.[ID], Tabell1.[namn], Tabell1.[lname] FROM Tabell1 WHERE (((Tabell1.[ID])=3))" RecordSource = cmdstr End Sub Private Sub Kommandoknapp7_Click() Dim cmdstr As String cmdstr = "SELECT Tabell1.[ID], Tabell1.[namn], Tabell1.[lname] FROM Tabell1 WHERE (((Tabell1.[ID])=2))" RecordSource = cmdstr End Sub Private Sub Kommandoknapp8_Click() Dim cmdstr As String cmdstr = "SELECT Tabell1.[ID], Tabell1.[namn], Tabell1.[lname] FROM Tabell1 WHERE (((Tabell1.[ID])=1))" RecordSource = cmdstr End Sub