I
Imran J Khan
In Access 97, I am trying to assign a recordset to DAO.RecordSet type
variable as follows:
Public Sub GetEmail (strSQL as String, strFieldEmpId as String)
Dim rsSale as DAO.RecordSet
Dim rsEmp as DAO.RecordSet
rsSale = strSQL
rsEmp = "SELECT fldEmail FROM tblEmployee WHERE empId = " & rsSale!empId
I want to replace rsSale!empId with some thing like:
rsSale!strFieldEmpId
so that I can pass to this routine the EmpID field name which would be vary.
I have tried the following:
strField = "rsSale!" & strFieldEmpID, but this does not get the value of the
empID and simply passes is as a string "rsSale!strFieldEmpID" to the next
statement.
Imran
variable as follows:
Public Sub GetEmail (strSQL as String, strFieldEmpId as String)
Dim rsSale as DAO.RecordSet
Dim rsEmp as DAO.RecordSet
rsSale = strSQL
rsEmp = "SELECT fldEmail FROM tblEmployee WHERE empId = " & rsSale!empId
I want to replace rsSale!empId with some thing like:
rsSale!strFieldEmpId
so that I can pass to this routine the EmpID field name which would be vary.
I have tried the following:
strField = "rsSale!" & strFieldEmpID, but this does not get the value of the
empID and simply passes is as a string "rsSale!strFieldEmpID" to the next
statement.
Imran