Create Your Own Custom Function in Microsoft Access VBA. User-Defined. C to F. F to C.

preview_player
Показать описание
Learn how to create your own custom, user-defined functions in Microsoft Access VBA (Visual Basic for Applications). We will start with a subroutine, and then create a couple functions. We will create a random number generator, and functions to convert Celsius to Fahrenheit and vice versa. You will learn how to pass parameter values to functions, and have them return a value.

Michael in Louisville KY (a Gold Member) asks: I'm familiar with the built-in Access functions like Date() and Now(). Is there a way I can create my own custom functions to perform the specific calculations I need?

LINKS:

BONUS FOR CHANNEL MEMBERS:
Silver Members and up get access to an EXTENDED CUT of this video which covers additional examples. That video will show you how to create public functions and global modules so your functions can be used in every form, report, and query in your database. You will see how to set a lower bound for your random numbers, so you can, for example, generate random numbers from 10 to 20. We will build a dice roller where you can roll any number of multi-sided dice in sets. Very handy for you gamers and D&D players who want to generate character stats. (This one's for the nerds like me).

MEMBERS ONLY VIDEO:

BECOME A MEMBER:

ADDITIONAL RESOURCES:

KEYWORDS:
ms access create function, calling a function in vba, vba function return, vba function arguments, vba global function, writing a simple function, vba editor, code builder, msgbox, hello world, parameter values, optional parameters, return value, random numbers, rnd, c to f, f to c, fahrenheit to celsius, celsius to fahrenheit, D&D, dice roller, dungeons & dragons, gamer dice, multi-sided dice, character stats

QUESTIONS:
Please feel free to post your questions or comments below. Thanks.
Рекомендации по теме
Комментарии
Автор

All your videos are one to one. Thanks

ramprakashmaurya
Автор

Good Lesson, quick & simple.
If not Randomize, will the function always generate the same number ?

llwbwdh
Автор

Good, but what i was looking for was how to calculate a table field (Age) invoking a VB function (Age()), passing it as parameter the content of another field (Age(Birthdate)) ...which implies that that function also knows what date is today (Now())....i found the code for that function on the internet but i dont know how to invoke it help!

juancarlosabad
Автор

You aren’t old 😭 my birthday is 1985…but October 23 is also my dads birthday 😁

tjisnotthatstupid
Автор

Hi Richard, Excellent instruction, Thankyou.
Do you have any guiding light youtube videos on navigating objects, I saw example in excel using "comments" object and a user has to open the correct im thinking it was "5" objects in the user vba help file out of the 200+ shown objects in the help index to connect thru code "comment" thru 5objects to enable then to colour in the comment box background .. of the comment object.which itself does not have a color method/property . Is there a map, a published directory or a better way to connect the dots to save a lot of time driving around town somewhat lost.. i know some are hierarchical and easy. Application.sheet etc.
Nice instruction videos
Vba objects sometimes returns a object but the help file says no more than this .. it happens, i believe to be range object it returns.. How would a NEW user SEE this please ?? I only read this example so was able to check. Might help unlock obstacles. Thanks for all your channel work.

allanwells
Автор

When making a random number generator would you get a more random answer if adding 100, 000, then after it's answer remove 100, 004 back to the six that are needwd for a dice?
Sorry I always ask stupid questions.

oppositeistrue
Автор

hello sir, my name is Yasser from Egypt, and i like your videos and following you long time ago. i wish my message finds you well and safe and i hope you answer my question which is" may i create a button to clear specific fields and keep the record as it is, thank you so much, can't wait for your replay.

yasserawad
Автор

I am a gold member ... I have no access to members-only YouTube videos. plz, help.

NoumanAzam
Автор

Can someone explain better that "maximize" at 9:03?

weibinren