mbiro
Programmer
- Nov 20, 2001
- 304
I am wondering how to store several if...then statements in a table and then call the statement in my vba code (calling the appropriate if..then from aparameter passed)?
Thinking...
a table-
id stmnt
1 if x=1 then...
2 if x=1 then...
3 if x=1 then...
vba -
Public Function artofunction(an8 As Long, cend As Integer)
Dim dbs As Database
Dim rst As Recordset
Dim x As Variant
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("SELECT tblcase.fmemo FROM tblaccounts RIGHT JOIN (tblcase RIGHT JOIN tblcasedtl ON tblcase.flngcase = tblcasedtl.flngcase) ON tblaccounts.flngan8 = tblcasedtl.flngan8 where tblcasedtl.flngan8 = " & an8, dbOpenDynaset)
While Not rst.EOF
x = rst!fmemo
rst.MoveNext
Wend
USING THE VALUE X TO USE THE IF...THEN STATEMENT RETURNED
End Function
Is this possible?
Thinking...
a table-
id stmnt
1 if x=1 then...
2 if x=1 then...
3 if x=1 then...
vba -
Public Function artofunction(an8 As Long, cend As Integer)
Dim dbs As Database
Dim rst As Recordset
Dim x As Variant
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("SELECT tblcase.fmemo FROM tblaccounts RIGHT JOIN (tblcase RIGHT JOIN tblcasedtl ON tblcase.flngcase = tblcasedtl.flngcase) ON tblaccounts.flngan8 = tblcasedtl.flngan8 where tblcasedtl.flngan8 = " & an8, dbOpenDynaset)
While Not rst.EOF
x = rst!fmemo
rst.MoveNext
Wend
USING THE VALUE X TO USE THE IF...THEN STATEMENT RETURNED
End Function
Is this possible?