Hi,
I have a function that accepts the field name as a parameter
Sub MyFunction(ByVal strName)
In the function I set the DAO recordset:
Set rst = CurrentDb.OpenRecordset("MeterVolumes"
Then I want to use the parameter strName as the field name of that recordset
.AddNew
rst!strName = whatever
.Update
the syntax is not correct. I tried rst! & strName, it didn't work as well. Is there a way to use a variable a recordset's field name
Please advise
THanks a lot
I have a function that accepts the field name as a parameter
Sub MyFunction(ByVal strName)
In the function I set the DAO recordset:
Set rst = CurrentDb.OpenRecordset("MeterVolumes"
Then I want to use the parameter strName as the field name of that recordset
.AddNew
rst!strName = whatever
.Update
the syntax is not correct. I tried rst! & strName, it didn't work as well. Is there a way to use a variable a recordset's field name
Please advise
THanks a lot