Access VBA error "Microsoft Access can't find the field '|' referred to in your experssion"

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top