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

Hints & tips

The textbox class in Visual FoxPro 9 has a new Autocomplete property which shows the user the previous values that have been entered in that textbox.
Autocomplete in VFP 9

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

FoxPro has always had functions to read and write files at a low level...
Foxpro low level file functions

More...
More pages of hints and tips for users of Microsoft FoxPro and Access databases.

Site Map