By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,391 Members | 1,653 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,391 IT Pros & Developers. It's quick & easy.

Convert string to command?

P: n/a
Hello everyone!

in a module in a function the following STRING is created:

CommandBars('OK Revisie').Controls(8).Enabled=False

Does anyone know how to execute this string as if it were a command?

TIA!!!

Henro

Oct 13 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On 13 Oct 2006 06:01:48 -0700, "Henrootje" <He****@gmail.comwrote:
>Hello everyone!

in a module in a function the following STRING is created:

CommandBars('OK Revisie').Controls(8).Enabled=False

Does anyone know how to execute this string as if it were a command?

TIA!!!

Henro
Check out the EVAL function in help.

Wayne Gillespie
Gosford NSW Australia
Oct 13 '06 #2

P: n/a

Wayne Gillespie schreef:
On 13 Oct 2006 06:01:48 -0700, "Henrootje" <He****@gmail.comwrote:
Hello everyone!

in a module in a function the following STRING is created:

CommandBars('OK Revisie').Controls(8).Enabled=False

Does anyone know how to execute this string as if it were a command?

TIA!!!

Henro

Check out the EVAL function in help.

Wayne Gillespie
Gosford NSW Australia
I did but it evaluates in '0' if false en -1 if true.......
Would I give in that string as a command it would disable the
control(8).
Eval does not. It actually does nothing but outputting a -1 or
0................. Or am I using it wrong? Just used it like
eval(string)

The help file also says al it does is generate the outcome of the
expression (in this case a string) as a number or as text..........I am
at a loss there/here

Oct 13 '06 #3

P: n/a
On 13 Oct 2006 10:12:32 -0700, "Henrootje" <He****@gmail.comwrote:
>
Wayne Gillespie schreef:
>On 13 Oct 2006 06:01:48 -0700, "Henrootje" <He****@gmail.comwrote:
>Hello everyone!

in a module in a function the following STRING is created:

CommandBars('OK Revisie').Controls(8).Enabled=False

Does anyone know how to execute this string as if it were a command?

TIA!!!

Henro

Check out the EVAL function in help.

Wayne Gillespie
Gosford NSW Australia

I did but it evaluates in '0' if false en -1 if true.......
Would I give in that string as a command it would disable the
control(8).
Eval does not. It actually does nothing but outputting a -1 or
0................. Or am I using it wrong? Just used it like
eval(string)

The help file also says al it does is generate the outcome of the
expression (in this case a string) as a number or as text..........I am
at a loss there/here
Create a Function which generates your string AND then applies it.
Then use Eval(MyFunction())

Or just call the function directly.
Wayne Gillespie
Gosford NSW Australia
Oct 13 '06 #4

P: n/a
Solved as in following post:

From: "Henrootje" <He****@gmail.com>
Newsgroups: comp.databases.ms-access
Subject: Re: Error 9: Subscript out of range
Date: Mon, 16 Oct 2006 11:30:20 -0000
Wayne Gillespie schreef:
On 13 Oct 2006 10:12:32 -0700, "Henrootje" <He****@gmail.comwrote:

Wayne Gillespie schreef:
On 13 Oct 2006 06:01:48 -0700, "Henrootje" <He****@gmail.comwrote:

Hello everyone!

in a module in a function the following STRING is created:

CommandBars('OK Revisie').Controls(8).Enabled=False

Does anyone know how to execute this string as if it were a command?

TIA!!!

Henro

Check out the EVAL function in help.

Wayne Gillespie
Gosford NSW Australia
I did but it evaluates in '0' if false en -1 if true.......
Would I give in that string as a command it would disable the
control(8).
Eval does not. It actually does nothing but outputting a -1 or
0................. Or am I using it wrong? Just used it like
eval(string)

The help file also says al it does is generate the outcome of the
expression (in this case a string) as a number or as text..........I am
at a loss there/here

Create a Function which generates your string AND then applies it.
Then use Eval(MyFunction())

Or just call the function directly.
Wayne Gillespie
Gosford NSW Australia
Oct 16 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.