I have a database for storing quality control results. A form is used for data entry, with text boxes (txtAbc, txtDef, etc) for entering the results of each type of test. Each has a corresponding textbox to display the lower and upper limits of the acceptable range for each test.
A For Each...Next routine fetches the range for each value, and assigns it to txtRange. So far, so good.
Within this routine, I want to put txtRange into the appropriate text box. I have given the pairs of boxes related names, ie txtAbc and txtAbcR, txtDef and txtDefR. Then I've used this:
The problem is with txtCR = txtRange, as txtCR is a variable, not a control name.
Any ideas?
A For Each...Next routine fetches the range for each value, and assigns it to txtRange. So far, so good.
Within this routine, I want to put txtRange into the appropriate text box. I have given the pairs of boxes related names, ie txtAbc and txtAbcR, txtDef and txtDefR. Then I've used this:
Code:
Dim txtCR as Control, txtC as String, txtRange as String
For Each txtCR In Me
If txtCR.Name = "txtC & 'R'" Then
txtCR = txtRange
End If
Next
The problem is with txtCR = txtRange, as txtCR is a variable, not a control name.
Any ideas?