how to convert subroutine to function?' I want to make a button on my form and want to add an event on_click. the event I want to add on click of button I made the event code but I dont know that how to convert it in function so that I can run in the macro and add it to button on_click event. so can anyone please tell me how to convert the sub code in function.????
Don't forget that a function should return a value.
I don't see why you can't add the sub to the on_click event but you probably have a good reason for that.
Here you can find some explanation about the difference : http://www.baldyweb.com/SubFunction.htm
There's something odd about calling functions or subs, sometimes you can't call a sub. (I might have the wrong end of the stick- Need to check when I get home) I'll put a link in when I find it.
I saw he mentioned macro's... I never use macro's behind buttons. I always use "Code Builder" and call my sub or function from there. Never had a problem calling subs that way...
how to make a code behind buttons to do event which is already an event on the form with different procedure.
explanation...
I have a form and on the form I have an event on dblclick. now I want to make a button on the same form to do the same thing on button click. now how I can do it??
can anyone tell me what this code mean is??DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70how I can know the number 8 mean in this code??I want full explanation of this code if anyone knows please tell me.thanks in advance....