Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pass field name parameter to update field in recordset

Status
Not open for further replies.

neemi

Programmer
May 14, 2002
519
GB
I am trying to write a function where I can pass a field name parameter to a recordset to update the rs...

I can't quite remember how to do this but now it is possible

I have the a parameter strCTL which is of string type and stores the name of the field in the rs....

set rs as currentdb.openrecordset(strSQL)
rs.addnew
rs!(strCTL) = some new data
rs.update

but I know that rs!(strCTL) is the wrong syntax!!! could someone pls help me urgently with the correct syntax please

help appreciated
neemi

 
try
Code:
set rs = currentdb.openrecordset(strSQL)
rs.addnew
rs("strCTL") = some new data
rs.update[/code
 
It just keeps saying that item not found in the collection but the feild value that is strCTL is definately in the rs declared!!
 
to claify strCTL is a parameter that stores the feild name and is not actually the feidl name...
 
sorry sb


rs(strCTL) = some new data


what is the value of strCTL
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top