- Joined
- Jul 20, 2012
- Messages
- 2
- Reaction score
- 0
I have a form with a large number of columns. I would like to show/hide the columns by lopping around a recordset. the recordset works fine it's just when I come to hide the column on the form I get the error message
"Microsoft Access can't find the field '|' referred to in your experssion"
Dim rc
Set rc = CurrentDb.OpenRecordset("select [Field],[Display] from vw_Display_frm_Sub_GTR_tb_ExportData")
With rc
Do Until .EOF
If rc!display = "Show" Then
Me.[rc!field].ColumnHidden = True
Else
Me.[rc!field].ColumnHidden = False
End If
.MoveNext
Loop
End With
Can anyone help me get the variable into the expression or is it not possible?
Regards
Steve
"Microsoft Access can't find the field '|' referred to in your experssion"
Dim rc
Set rc = CurrentDb.OpenRecordset("select [Field],[Display] from vw_Display_frm_Sub_GTR_tb_ExportData")
With rc
Do Until .EOF
If rc!display = "Show" Then
Me.[rc!field].ColumnHidden = True
Else
Me.[rc!field].ColumnHidden = False
End If
.MoveNext
Loop
End With
Can anyone help me get the variable into the expression or is it not possible?
Regards
Steve