Question : What is the Best Way to Setup Microsoft Access Record Navigation?

I have a very simple Microsoft Access form.  Single field on the form.  I'm allowing form navigation so the user can scroll through the records and add a record but the form is in Pop Up mode (required!!) so all other types of record manipulation are not available.  What is the best way to allow them to delete a record, find a record, save the current record, and close the form?  I need examples of the code.  Thank you.

Answer : What is the Best Way to Setup Microsoft Access Record Navigation?

Please see the code below, I assume you will be putting command buttons on the form. All of the code was generated automatically when I created the command buttons using the Button wizard and specifying what I wanted it to do.

Cheers, Andrew
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
Private Sub cmdDelete_Click()
On Error GoTo Err_cmdDelete_Click
 
 
    DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
    DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
 
Exit_cmdDelete_Click:
    Exit Sub
 
Err_cmdDelete_Click:
    MsgBox Err.Description
    Resume Exit_cmdDelete_Click
    
End Sub
 
Private Sub cmdFindRecord_Click()
On Error GoTo Err_cmdFindRecord_Click
 
 
    Screen.PreviousControl.SetFocus
    DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
 
Exit_cmdFindRecord_Click:
    Exit Sub
 
Err_cmdFindRecord_Click:
    MsgBox Err.Description
    Resume Exit_cmdFindRecord_Click
    
End Sub
 
Private Sub cmdSaveRecord_Click()
On Error GoTo Err_cmdSaveRecord_Click
 
 
    DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
 
Exit_cmdSaveRecord_Click:
    Exit Sub
 
Err_cmdSaveRecord_Click:
    MsgBox Err.Description
    Resume Exit_cmdSaveRecord_Click
    
End Sub
 
Private Sub cmdCloseForm_Click()
On Error GoTo Err_cmdCloseForm_Click
 
 
    DoCmd.Close
 
Exit_cmdCloseForm_Click:
    Exit Sub
 
Err_cmdCloseForm_Click:
    MsgBox Err.Description
    Resume Exit_cmdCloseForm_Click
    
End Sub
Random Solutions  
 
programming4us programming4us