Mervyn Bick
2008-09-24 16:01:57 UTC
Im using macro substitution for the first time and Im having a little
problem
....
for fieldcount = 1 to rControls.fields.size
cmd = "form." + trim(rControls.fields[fieldcount].fieldname) +
".text = " + trim(rControls.fields[fieldcount].value)
&cmd
endfor
I am prompted with 'Expression expected' on the &cmd command.
Any ideas??
The first thing I do when a macro doesn't work as expected is toproblem
....
for fieldcount = 1 to rControls.fields.size
cmd = "form." + trim(rControls.fields[fieldcount].fieldname) +
".text = " + trim(rControls.fields[fieldcount].value)
&cmd
endfor
I am prompted with 'Expression expected' on the &cmd command.
Any ideas??
temporarily change the & to ? which will cause the contents of the
variable to print. Nine time out of ten the string is not what I had
intended it to be and I can then set about correcting it.
Mervyn.