G
Guest
I need to know if there is an evaluate command for strings in Access?
For example, if I create a variable lsSQL that contains the value:
lsSQL = "[Field1] = ' " & rsRecordset(""Field1"") & " ' "
and then I open a recordset and want to use the lsSQL as a parameter for the
FindFirst command, like this:
rsAnotherRecordset.FindFirst lsSQL
I need to evaluate lsSQL first, because if rsRecordset(""Field1"") contains
"My Value", then I want the FindFirst to do this:
rsAnotherRecordset.FindFirst "[Field1] = 'My Value' "
and not do this:
rsAnotherRecordset.FindFirst "[Field1] = ' " & rsRecordset(""Field1"") & " ' "
So, I need a command that will do something like this:
rsAnotherRecordset.FindFirst Evaluate(lsSQL)
Dave
For example, if I create a variable lsSQL that contains the value:
lsSQL = "[Field1] = ' " & rsRecordset(""Field1"") & " ' "
and then I open a recordset and want to use the lsSQL as a parameter for the
FindFirst command, like this:
rsAnotherRecordset.FindFirst lsSQL
I need to evaluate lsSQL first, because if rsRecordset(""Field1"") contains
"My Value", then I want the FindFirst to do this:
rsAnotherRecordset.FindFirst "[Field1] = 'My Value' "
and not do this:
rsAnotherRecordset.FindFirst "[Field1] = ' " & rsRecordset(""Field1"") & " ' "
So, I need a command that will do something like this:
rsAnotherRecordset.FindFirst Evaluate(lsSQL)
Dave