G
Guest
I have to compare different tests we give our middle school students.
I have a form with 155 Fields. I have to seach each field (That fit 5
catagories) to see what the contents are and then find the range(s) which are
stored in a table.
Here is the code I have so far.
Rem: Store All The Field Names for a catagory. The Contents of
Me!TxtAC09 is 356.
Rem: I Check every field of a catagory Set.
Do Until IndxA = 20
IndxA = IndxA + 1
If IndxA < 10 Then
HldField = "TxtAC0" & IndxA
Else
HldField = "TxtAC" & IndxA
End If
HldWork = "Me!" & '" & HldField & "'
Rem: My problem is the above Line. I want the contents of HldWork (356),
not TxtAC09.
Rem: Below I then get the record I need.
GetRangeRec (HldWork)
Loop
End Sub
GetRangeRec
Set rstI = db.OpenRecordset("SELECT * FROM VermontSchls WHERE '" & HldWork &
"' = HSARCD")
MsgBox rstI!LSCHOOL & " " & HldField Rem: Test to see If
I Got The Right Record
End Sub
I did this once before but I just cannot remember the syntex to do it again.
Any Help Appreciated;
Thanks in Advance,
Granny
I have a form with 155 Fields. I have to seach each field (That fit 5
catagories) to see what the contents are and then find the range(s) which are
stored in a table.
Here is the code I have so far.
Rem: Store All The Field Names for a catagory. The Contents of
Me!TxtAC09 is 356.
Rem: I Check every field of a catagory Set.
Do Until IndxA = 20
IndxA = IndxA + 1
If IndxA < 10 Then
HldField = "TxtAC0" & IndxA
Else
HldField = "TxtAC" & IndxA
End If
HldWork = "Me!" & '" & HldField & "'
Rem: My problem is the above Line. I want the contents of HldWork (356),
not TxtAC09.
Rem: Below I then get the record I need.
GetRangeRec (HldWork)
Loop
End Sub
GetRangeRec
Set rstI = db.OpenRecordset("SELECT * FROM VermontSchls WHERE '" & HldWork &
"' = HSARCD")
MsgBox rstI!LSCHOOL & " " & HldField Rem: Test to see If
I Got The Right Record
End Sub
I did this once before but I just cannot remember the syntex to do it again.
Any Help Appreciated;
Thanks in Advance,
Granny