Creating Event Procedure Programatically

  • Thread starter Thread starter Mark A. Sam
  • Start date Start date
M

Mark A. Sam

Hello,

I am seeking a method of changing an event procedure in a ADP at the form
opens, pulling the code from an SQL Table, so that I can update the Timer
Event without updating the client. I have searched and searched and
couldn't find anything to help me. All I need is to create a function or
subroutine which I can call from the Timer event. This will be an .ADE so
it will need to be able to update without taking a form to design mode. Any
sample or pointing me in the right direction would be appreciated.

God Bless,

Mark A. Sam
 
You can make your timer event proc, set timer interval to 0. then on form
load you pull a code from table and set timer inteval to value you need -
your event proc starts working
 
Alex,

That's exactly my plan, but I don't know how to implement it. How do I load
the event procedure up with the code?

God Bless,

Mark
 
Hi Mark,
you dont need to load it, just make it as any other proc.
it will not run until you make TimerInterval greater then 0
 
Alex,

I think you misunderstood my request. I don't want to set the TimerInterval
property, I want to create the Code in the Timer Event with programming, so
that I can change it without having to update the application. In other
words, the table will contain the procedure in a text field, which will be
read while a form is opening and the event procedure will be generated.

God Bless,

Mark
 
Hi Mark,
this you can not do with ADE. that is why i proposed you such workaround
you can do this in ADP, but then you need to have form opened in design mode
 
It that what you meant when you said, " just make it as any other proc "?
If I can't do that in an .ade, then it won't help me. Is there a way to Dim
a module object,populate it and run that from memory? Does that make sense?
 
Hi Mark,
It that what you meant when you said, " just make it as any other proc "?
i didnt realized that you really need to make a proc in ADE
If I can't do that in an .ade, then it won't help me. Is there a way to
Dim
a module object,populate it and run that from memory? Does that make
sense?
in ADE - no, it is a compiled one, and there is no way to manipulated with
code.
 
I don't want to set the TimerInterval
property, I want to create the Code in the Timer Event with programming,

Self-modifying code is sooooo 1960's... and good riddance to it too.

Why bother, anyway, when it's so easy just to copy a new ADE with the
amended code over the old one?

B Wishes


Tim F
 
1960's ?????? I thought it was a revelation. ;)

I plan to distribute these to various clients and each client will have
specific ID info for that company, particularly login info as Global
Constants. This will require me to update each client individually. I
guess I'll have to work something else out, maybe another database with the
login data.

God Bless,

Mark
 
Thanks Alex. I didn't want to have to deal with other tables. I was hoping
for one single file that they could download in any folder and simply be
able to open and use it. I'll figure something out later.

God Bless,

Mark
 
I plan to distribute these to various clients and each client will have
specific ID info for that company, particularly login info as Global
Constants.

Use the Properties collection of the Database object if the users are not
meant to see them. Use the

database.containers("databases").documents("userdefined").properties

collection if they are meant to be user-accessible -- this is the page that
appears on the Access GUI Database | Properties menu option.

It's far easier to set these programmatically than trying to mess about
with remote reprogramming. And your clients get to see real new versions
appearing, and they also get the chance to revert to the previous working
client interface when the new one breaks...

All the best


Tim F
 
Back
Top