Does anyone know if there is a way to use a string concatenation to refer to a control name. eg. Referring to Control1, Control2, Control3, Control4, etc using something like Me.["Control" & "1"], Me.["Control" & "2"], etc
Does anyone know if there is a way to use a string concatenation to refer to a control name. eg. Referring to Control1, Control2, Control3, Control4, etc using something like Me.["Control" & "1"], Me.["Control" & "2"], etc
For n = 1 to 4
Me("Control" & n)
Next
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Tried your suggestion. The compiler had a problem with Me("Control" & n).
It works for me. Don't know why it doesn't for you. Post your entire relevant code. Are your controls actually named Control1, Control2, etc?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
I tried this
for n = 1 to 4
me(n & "QTY") = n ' Just load the variable with the value of n for now to see if code works
next n
The compiler immediately changed me(n & "QTY") to Me (n & "QTY") and threw an error when I tried to run it.
My controls are actually named Me.[1QTY], Me.[2QTY], Me.[3QTY] .. Me.[19QTY]
IT WORKS NOW!!!
I retyped the code as you had it and tried it again. I don't know what happened the first time.
Thank you SOOOO Much !!!!
Don.