The structured work with data is crucial for the success of any software solution. A fundamental component of this are uniform naming conventions. In programming, there is a special technique that significantly improves the overview of variables, functions, and other elements: the Hungarian Notation. This technique ensures that you can act purposefully and efficiently while working with programming scripts and databases.

In this guide, I will introduce you to Hungarian Notation and its application in Microsoft Access. I will explain what it is about, what advantages it offers, and how you can effectively implement it in your projects.

Key insights

  • The Hungarian Notation is a naming convention for naming variables and objects.
  • It improves the readability and maintainability of the code.
  • The standard prefixes for different database objects are important for quickly identifying their type.
  • Microsoft recommends the use of Hungarian notation as a best practice.

Step-by-Step Guide

What is Hungarian Notation?

Hungarian Notation is a method for naming variables and objects in programming. It is a concise system that allows you to instantly recognize the type and function of an object. This convention was developed by Charles Simonyi, a Hungarian computer scientist, who wanted to establish a uniform naming system.

Hungarian Notation in Access: Professional and Clear

Why is Hungarian Notation useful?

By using prefixes, the naming of objects is standardized. A precise structure allows for a clear distinction between different types of objects. For example, if you create a table in your database called "Customers," you would add the prefix "tbl" for "table," changing the name to "tblCustomers." This way, you know that it is a table.

The Standard Prefixes

There are various standard prefixes that are widely used:

  • tbl for tables
  • qry for queries
  • FRM for forms
  • RPD for reports
  • MOD for modules

These prefixes are not just a simple addition, but they bring order to your projects and make programming easier, especially when working with many objects.

Example Application

Now let's consider a practical example: imagine a table where customer data is stored. You would call it "tblCustomers." If you additionally have a query for the customer data, it would be named "qryCustomerQuery." Future accesses to these objects will be faster and clearer. You can immediately recognize what they are.

Hungarian notation in Access: Professional and clear

Extended Fields and Their Identifiers

The naming for fields also follows Hungarian notation to clarify the type of data. For a text field, the name could be "txtCustomerName," while a boolean field could be called "blnActive." These names ensure that the development process runs smoothly and you have no misunderstandings in the code.

Hungarian Notation in Access: Professional and Clear

Creative Use of Prefixes

It is important to know that you are not strictly bound to the provided prefixes. Depending on the size and complexity of the project, you can also create or modify your own prefixes. For example, if you are working on a smaller project, you may not need prefixes, provided your names are sufficiently clear and unambiguous.

Hungarian Notation in Access: Professional and Clear

Summary – Become a Data Hero in Access: Understand and Apply Hungarian Notation

Hungarian Notation is a proven method for standardizing names in programming. It not only facilitates programming in Microsoft Access but also improves the maintainability of your applications. By using simple and uniform identifiers, you bring order to your projects and can work efficiently. Utilize the diverse possibilities of this naming convention to make your software projects more professional.

Frequently Asked Questions

What advantages does Hungarian Notation offer?Hungarian Notation improves the readability of the code and facilitates maintenance, as the type of variables is immediately apparent.

Where can I find the standard prefixes for my projects?You can find the standard prefixes in the Microsoft Access documentation or online in various resources.

Do I have to use Hungarian Notation all the time?The application of Hungarian Notation is recommended, but not mandatory. Depending on the project, it may make sense to choose different identifiers.

Can I create my own prefixes?Yes, you can develop your own prefixes to adapt them to the context of your project.

What are examples of common prefixes?Common prefixes include tbl for tables, qry for queries, and txt for text fields.