|
||||||
|
ByRef v ByVal By Richard Rost 4 years ago ByRef v ByVal in VBA. Creating an Increment Operator. If you're familiar with languages like C there is an increment operator. To increase the value of X all you have to do is write X++ whereas in VB you have to say X=X+1. That doesn't seem like a lot of extra work, unless you have a long variable name like "CustomerStatementCounter" or something like that. So, wouldn't it be nice to create our own increment operator so all we have to say in our code is Inc X and that's it. That's what this lesson covers, and to do it, I'll teach you the different between ByRef and ByVal variable calls in our subs and functions. Alex from England (Admin) asks, "After watching yesterday’s Extended Cut video, you mentioned that Access VBA doesn’t have an Increment Operator like C does which is ++. Does it support +=" MembersI'll show you how to use optional parameters, use our increment sub with a form field instead of just a variable, determine if a value is numeric, and create a public global subroutine or function.
Silver Members and up get access to view Extended Cut videos, when available. Gold Members can download the files from class plus get access to the Code Vault. If you're not a member, Join Today! Prerequisites
Links
|
||||||||||||||||||||
| |||
Keywords: TechHelp Access Increment Operator Pass by Reference Pass by Value ++ += PermaLink ByRef v ByVal in Microsoft Access |