Get the Name of an Object
When coding you often use the names of different objects: filenames, fields, ranges, etcetera. If you know a name you can simply type it, but selecting it instead does have its advantages:
- Save time typing - in case of long names
- Prevent bugs caused by typos
Insert name of file or folder
Often names are related to the current locatie of your application file:
Alt-CND | Menu: Code VBA » Name » Crrent Document |
A convenient way to get a file or folder path is by using the file (or folder) selection dialog
Alt-CNFF | Menu: Code VBA » Name » Select File |
Alt-CNFFF | Menu: Code VBA » Name » Select Folder |
Click this to see how to insert a file name.
Insert name of MS Access objects Table, Query, Form or Report and their Fields or Controls
The approach works for MS Access objects Table, Query, Form and Report and their Fields or Controls. These can be reached either via the Name submenu or via the Access menu, e.g.:
Alt-CNFF | Menu: Code VBA » Name » Form » [Enter] » frmCustomer |
Alt-CAFNF | Menu: Code VBA » Access » Form » Name » frmCustomer |
Control names only appear in the list if the Access Form or Report is open, so you have to do so before you can start inserting control names this way!