VBA Access How to Next and Previous Data by CurrentDb - learnit

Home Top Ad

Post Top Ad

Wednesday, July 21, 2021

VBA Access How to Next and Previous Data by CurrentDb

VBA Access How to Next and Previous Data by CurrentDb

Today I will show you how to use CurrentDB, or, briefly, how to connect to a database and set up Button 2 after we have connected to the database. The first is to make a forward-scrolling Button, and the second is to make a backward-scrolling Button. However, before you begin, please address the following critical points.


Introduction to Microsoft Access

A database is a list of values stored somewhere. A computer database is a list or a group of lists stored in a computer disc such as a hard drive. Microsoft Access is an application used to create and manage computer databases.


The Structured Query Language (SQL)

The structured query language, or SQL, is the primary language used to perform database operations. SQL can also be spelled Sequel or S. Q. L. We will look at the Sequel pronunciation in our lessons. As a result, the abbreviation will always be treated as a word, resulting in "A SQL statement" rather than "A SQL statement." In addition, in these lessons, we will write on a regular basis,"The SQL" rather than "The SQL language," because the L already stands for Language. SQL, like other computer languages, has syntax, vocabulary, and rules. The SQL is outfitted with keywords that tell it what to do and how to do it. SQL can be used, interpreted, and applied in a variety of ways in Microsoft Access.


Microsoft Visual Basic Fundamentals

Only Microsoft Access can be used to create a fully functional database. In some cases, writing code is required to obtain a more complex database. Microsoft Access comes with and installs a programming environment called Microsoft Visual Basic to support this. This is a (smaller) version of the popular Microsoft Visual Basic language and environment, but it includes everything needed to create and manage applications.


VBA is an abbreviation for Visual Basic for Applications (the application is, of course, Microsoft Access), and it refers to the technology and tools used to program and automate this application.


It is used not only within the framework of Microsoft Access Database, but also in other applications such as Microsoft Excel, Microsoft Word, and Microsoft Outlook, to name a few. It has the ability to communicate with applications outside of the Microsoft range, as well as the Microsoft Windows operating system on other platforms. As a result, learning the fundamentals of VBA with Access as the tool environment.


1.Manage smaller re-usable procedures (globally).

2.Create you own defined functions.

3.Hold variables in memory (globally).

4.Attach code to an event i.e. a button on a form.

5.Manage more powerful procedures that an Access macro lacks.

6.Communicate with other applications and platforms.

7.Gracefully handle errors (when they happen).


The CurrentDb () Function

Access maintains a single permanent reference to the current database at all times. At startup, the first member of the Databases collection is populated with a reference to the current database. Microsoft devised a solution in the form of the CurrentDb () function. CurrentDb (optional parentheses) is not an object. A built-in function returns a reference to the current user's default settings.

Example

Prviate sub cmdNext_Click()
if not rs.EOF Then
rs.MoveNext
End if
End sub


Prviate sub cmdNext_Click()
if Not rs.BOF Then
rs.MovePrevious
End if


Please Watching My Video is Below

No comments:

Post a Comment

Post Top Ad