Hi,
I wonder if anyone can help please.
I have the following statement:
If rsAct("InvoiceLine_ItemRef_FullName") <> "Discount" _
And rsAct("InvoiceLine_ItemRef_FullName") <> "URGENT" _
And rsAct("InvoiceLine_ItemRef_FullName") <> "Courier" Then
Debug.Print 'Working'"
End If
However, since the 'Discount', 'Urgent' and 'Courier' may vary from one situation to another, I would like to have these values pulled from a Table and create a dynamic IF-THEN statement that can be evaluated.
In other words, I have composed the following:
QBStmt = " rsAct(" & Chr(34) & "InvoiceLine_ItemRef_FullName" & Chr(34) & ") <> '" & rsQ("Response_For") & "' AND "
QBStmt = Left(QBStmt, Len(QBStmt) - 4)
QBStmt = "If " & QBStmt & " Then Debug.Print 'Working'"
Eval (QBStmt)
However, this does not work.
I do not know if one can create and IF-THEN statement pulling in recordset fields.
Can anyone assist?
Harris
I wonder if anyone can help please.
I have the following statement:
If rsAct("InvoiceLine_ItemRef_FullName") <> "Discount" _
And rsAct("InvoiceLine_ItemRef_FullName") <> "URGENT" _
And rsAct("InvoiceLine_ItemRef_FullName") <> "Courier" Then
Debug.Print 'Working'"
End If
However, since the 'Discount', 'Urgent' and 'Courier' may vary from one situation to another, I would like to have these values pulled from a Table and create a dynamic IF-THEN statement that can be evaluated.
In other words, I have composed the following:
QBStmt = " rsAct(" & Chr(34) & "InvoiceLine_ItemRef_FullName" & Chr(34) & ") <> '" & rsQ("Response_For") & "' AND "
QBStmt = Left(QBStmt, Len(QBStmt) - 4)
QBStmt = "If " & QBStmt & " Then Debug.Print 'Working'"
Eval (QBStmt)
However, this does not work.
I do not know if one can create and IF-THEN statement pulling in recordset fields.
Can anyone assist?
Harris