MarkRobinson
Programmer
I want to fill all fields in a do loop, which requires that the rs1.<fieldname> be a variable
The code below doesn't work. I need "rs1.fname" to be "rs1.<contents of fname>."
Set db = CurrentDb
q1 = "SELECT FName, address, phone from msg1;"
Set rs1 = db.openrecordset(q1)
mcount=1
rs1.addnew
do while mcount<4
fname =rs1(mcount).Name 'Fname on the first pass, etc
rs1.fname="Text for Fname" 'DOESNT WORK
mcount=mcount+1
loop
Rs1.Update
The code below doesn't work. I need "rs1.fname" to be "rs1.<contents of fname>."
Set db = CurrentDb
q1 = "SELECT FName, address, phone from msg1;"
Set rs1 = db.openrecordset(q1)
mcount=1
rs1.addnew
do while mcount<4
fname =rs1(mcount).Name 'Fname on the first pass, etc
rs1.fname="Text for Fname" 'DOESNT WORK
mcount=mcount+1
loop
Rs1.Update