From the course: Access: VBA
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Create a calculation using mathematical operators
From the course: Access: VBA
Create a calculation using mathematical operators
- [Interviewer] When you analyze data in Access, you will often use mathematical operators to create the expressions you need. In this movie, I will describe the operators available to you and show you how to use them. I have opened the course database and I'll press alt F11 to move to the visual basic editor. I need to work in a code module. So I will create one by clicking the insert ribbon header and then clicking module. There we go. Let's assume that you work for an alternative energy company and you sell light bulbs that are energy efficient. You might want to perform some calculations based on the number of light bulbs that you have. So I'll start by creating a sub routine. I'll just call it sub explore. That will allow us to explore number values. Type left and right parentheses cause we're not passing any values. And after pressing enter a couple of times, we have some room to work. I'll start by declaring a variable. I'll call it dim iTotal as integer. Then a comma…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Introduction to Access data types3m 53s
-
(Locked)
Declare variables and require declaration before using5m 28s
-
Manage variable scope4m 47s
-
(Locked)
Define constants and static variables7m 23s
-
(Locked)
Create a calculation using mathematical operators4m 57s
-
(Locked)
Display a calculated result in a message box4m 2s
-
(Locked)
Define an array7m 12s
-
(Locked)
Define and use an object variable3m 57s
-
(Locked)
-
-
-
-
-
-
-
-