ID codes for CommandBarButtons

When CommandBarButtons are added to a CommandBar in Access their Id property defines their icon and their default behaviour:

'-- Create a command bar with three buttons
Set myBar = CommandBars.Add(Name:="Customer", _
            Position:=msoBarTop, _
            Temporary:=True)
With myBar
  .Controls.Add Type:=msoControlButton, Id:=539
  .Controls.Add Type:=msoControlButton, Id:=4
  .Controls.Add Type:=msoControlButton, Id:=644
.Visible = True
End With

Every button in the Access toolbar system has its own Id code but these are the most useful:

Icon Id   Description
[Cut icon] 21   Cut
[Copy icon] 19   Copy
[Paste icon] 22   Paste
       
[New Record icon] 539   New Record
[Delete Record icon] 644   Delete Record
       
[Sort Ascending icon] 210   Sort Ascending
[Sort Descending icon] 211   Sort Descending
[Filter icon] 640   Filter By Selection
[Remove filter icon] 605   Remove Filter/Sort
       
[Page Setup icon] 247   Page Setup
[Print icon] 4   Print
[Send Email icon] 258   Send Email

Access Tips

FoxPro Tips

General Tips

 

Related Items

Custom Toolbars

Your Access database will look more impressive if you add custom toolbars.

Read More

Frequent, automatic backups

How to create backups automatically in FoxPro or Access using the Windows Scripting Host

Read More

Trimming text in VBA and VFP

Both Visual FoxPro and Visual Basic for Applications let you trim leading and trailing spaces from string of text

Read More

Finding characters in VBA and VFP

Both Visual FoxPro and Visual Basic for Applications let you find the position of one character inside another string.

Read More

Changing between upper and lower case in VBA and VFP

Both Visual FoxPro and Visual Basic for Applications let you chnage text between upper and lower case.

Read More