using modules

CesarAustin

Board Regular
Joined
Aug 21, 2004
Messages
151
Ok. I’m sorry about this question.. I have been using access for a some time now… I can create all kinds of queries using the query design…. I can also understand the SQL behind it... I posted a question early this week about calculating business days between to dates. I found a module that I can use.. but I don’t know how to use it. Can some one direct me somewhere were I can learn how to apply the modules…. I have been searching the web and just can’t find anything I understand. Pls pls help.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Here's a quick overview.

1. Create a new module and paste the code that you found into it. You will have one or more Function procedures in the module. Save the module, but DON'T use the same name for the module as for the functions within module -- apparently Access doesn't like it. Now you'll have modMyModule, containing Function1, Function2, etc (being generic here).

2. To use the code, you call it from another routine in a module, from the event code for a button or other control, or via an expression in a query.

To call from another procedure in a standard module:
Call modMyModule.Function2

To trigger from a button:
Place the button on a form. Go to Design view, select the Properties for the button, click the Events tab. Double-click the blank line next to On Click. You'll see Event Procedure. Click the Builder (...) button and you'll be in the event modult for the form. Type
modMyModule.Function2

To use in an expression:
If your function is intended to return a calculated result, use it in a query as you would any other built-in function.

Hope that gets you started

Denis
 
Upvote 0

Forum statistics

Threads
1,221,851
Messages
6,162,429
Members
451,765
Latest member
craigvan888

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top