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, _
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

American date formats used by Access SQL

Microsoft Access uses an American date format in SQL commands

Read More

Backing up an Access Database

How to backup an Access database using VBA and DAO

Read More

Creating a datestamped filename in Access

How to create a filename from a datestamp

Read More