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

Create a calculation using mathematical operators

From the course: Access: VBA

Start my 1-month free trial

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…

Contents