Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / March 2005

Tip: Looking for answers? Try searching our database.

how to generate dynamic if statements

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
siddahuja - 09 Mar 2005 15:41 GMT
Hi

please have a look at the following code:

dim var_range as variant
dim var_first_field as variant
dim var_second_field as variant

what i would like to do is use an if statement to compare the
"var_first_field" with var_second_field" by using the "var_range"

for example:

var_first_field=25
var_second_field=30
var_range=>

what i want it to do is:
if 25>30 then
  msgbox("hi")
endif

how do i generate the code such that

if var_first_field & var_range & var_second_field then
 msgbox("hi"
endif
Sandra Daigle - 09 Mar 2005 15:54 GMT
Try using the Eval function:

if Eval (var_first_field & var_range & var_second_field) then
 msgbox "hi"
endif

Signature

Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.

> Hi
>
[quoted text clipped - 23 lines]
>  msgbox("hi"
> endif
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.