Silly question (1 Viewer)

Charlie

Registered User.
Local time
Today, 07:03
Joined
Jan 7, 2000
Messages
16
Dear fellow developers,

I know this is going to sound like a really low brain question so I'm sorry.

How can I call a function from within an event proceedure?

What I have is a form that is based upon the date of the records kept ie each new date brings up a whole new set of records. I have some buttons that allow the user to jump day, month or year forwards and backwards. Each of these buttons needs to check whether the new date is/will be/was a holiday or weekend and I have written a proceedure to do this.

However in the search for elegance and my own lazyness, ideally I'd like to write one function/method and call it as each button is clicked. Again I'd rather not have to use the macro builder as it confuses me and I prefer doing it in code as I understand this a little more!!

I'm sure that the answer is probably staring me in the face but I don't appear to be able to see it!

Thanks for your time.

Charlie
 

R. Hicks

AWF VIP
Local time
Today, 01:03
Joined
Dec 23, 1999
Messages
619
Charlie
This not a silly question. What is simple to some people may be a major roadblock for others.
Choose the event you wish to run the function/method, then add the Call statement.
Here's an example:

Private Sub cmdDoSomething_Click()
Call YourFunction/Method(yourArgs)
End Sub

This uses a cmdbutton's On Click event.

Replace "YourFunction/Method" with the actual name of your procedure and place any arguments needed in the parentheses.

HTH
RDH
 

Users who are viewing this thread

Top Bottom