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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pls help me out with this

Status
Not open for further replies.

sabavno

Programmer
Jul 25, 2002
381
CA
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top