Mathematician
Registered User.
- Local time
- Today, 10:40
- Joined
- Nov 23, 2007
- Messages
- 17
Hi all,
I would like to create the following code:
------------------------------------
sub test()
condition= "4=4 and 5=5 and 6=6"
result="msgbox("It is ok")"
if condition then result
end if
end sub
------------------------------------
or
sub test2()
sentence="if 4=4 then msgbox("im the boss")"
sentence
end sub
------------------------------------
Do you have any idea how to make the two above work? The code doesn't recognize "=" and "and" words from the condition string it is not treated as if structure.
I wanted to do so because I have table and in one column I have in each row the all sequence for example (if 4=4 then msgbox("im the boss")).
So I wanted to use:
if currentdb().openrecordset("Table")![Condition] then currentdb().openrecordset("Table")![Result]
Many thanks in advance for any clue
Mathematician
I would like to create the following code:
------------------------------------
sub test()
condition= "4=4 and 5=5 and 6=6"
result="msgbox("It is ok")"
if condition then result
end if
end sub
------------------------------------
or
sub test2()
sentence="if 4=4 then msgbox("im the boss")"
sentence
end sub
------------------------------------
Do you have any idea how to make the two above work? The code doesn't recognize "=" and "and" words from the condition string it is not treated as if structure.
I wanted to do so because I have table and in one column I have in each row the all sequence for example (if 4=4 then msgbox("im the boss")).
So I wanted to use:
if currentdb().openrecordset("Table")![Condition] then currentdb().openrecordset("Table")![Result]
Many thanks in advance for any clue
Mathematician