Updating VBA event code at runtime

  • Thread starter Thread starter CyberDwarf
  • Start date Start date
C

CyberDwarf

Hi

I'm sure this has been asked before, so my apologies in advance for dumb
questions!!!

Has anyone been able to update the VB code for events fired by, eg., command
buttons?

Any suggestions greatly appreciated

Steve
 
Hi Douglas

Thanks for your reply.

I have a requirement to change the way events fire, depending on the user of
the form.

Eg., client1 needs the standard event code, but client2 needs the event to
perform a different action (sorry I can't be more specific, but I'm already
running into non-disclosure arguments!!).

Problem is that I have a set-in-concrete startup routine which already sets
certain client parameters (changes labels, hides text fields, changes sort
orders, etc) and I have to operate within this setup. I know there are other
(easier!) ways to solve this, but.....

Prime example, tho', is the need to amend the VB code which is fired from
the Help button (this is client specific).

BTW, thanks for the MSDN link

Steve
 
CyberDwarf said:
Hi Douglas

Thanks for your reply.

I have a requirement to change the way events fire, depending on the
user of the form.

Eg., client1 needs the standard event code, but client2 needs the
event to perform a different action (sorry I can't be more specific,
but I'm already running into non-disclosure arguments!!).

Problem is that I have a set-in-concrete startup routine which
already sets certain client parameters (changes labels, hides text
fields, changes sort orders, etc) and I have to operate within this
setup. I know there are other (easier!) ways to solve this, but.....

Prime example, tho', is the need to amend the VB code which is fired
from the Help button (this is client specific).

BTW, thanks for the MSDN link

Steve

You would not accomplish this by modifying the code on the fly. You would
run *different* code...

If (However you determine the user) = "client1" Then
Call SomeSubRoutine
Else
Call SomeOtherSubRouitne
End If
 
Rick

Yup, all understood & agreed, BUT....

I have had the restrictions imposed on me ;-(

Thanks

Steve
 
Douglas

Thanks again for the link. I now have working code!!!

Very useful stuff

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top