direct vba window in an access form

  • Thread starter Thread starter Stephan Gehrlein
  • Start date Start date
S

Stephan Gehrlein

Has anybody an idea how I could execute VBA procedures or functions from an
access 2000 ade form?
I would like to generate a hidden administrative form with a text field to
put in vba procedure calls and execute them from an ade without having
access to the vba editor.
So this way I could run something like:

clsUser.New_User("username", "userPW", "userrole",...) or other procedures
or functions.

How do I have to write the code for that text field, how do I execute the
VBA string by code?

Thanks for any suggestions
Stephan
 
For the whole form look at form_load
for a field look at fieldname_gotfocus.
to get there rt click on the form/file and select buildevents.
then look in the dropdown in the upper right corner.
 
Thank you for your reply, but I wasn't looking for an event to fire
VBA procedures or functions, I am looking for the command which
executes VBA code that I put as a string into a textfield of a form.
Do you have any hints on that?

Thanks in advance
Stephan
 
Perhaps the script control on the form?

Paul
Stephan Gehrlein said:
Thank you for your reply, but I wasn't looking for an event to fire
VBA procedures or functions, I am looking for the command which
executes VBA code that I put as a string into a textfield of a form.
Do you have any hints on that?

Thanks in advance
Stephan

"BJ Freeman" <[email protected]> wrote in message
 
you can not, as far as I know, put a sub /function in string and call it.
However you might look at WithEvents, and see if it will help you.
 
Found a way:
eval("string") for functions and
run(vbastring,parameter1,parameter2,....parameter30) for procedures!
works fine except for class functions and procedures. In these cases
you have to generate a kind of buffer procedure to call the class
procedure from there:
e.g.: public function call_class_functionx
call_class_functionx = clsclass.functionx()
end function

Thanks for everybody's help
Stephan
 
Back
Top