Greetings All!
I feel rather lowly for failing to see the err in my ways, but for the life of me I can’t figure out what I’ve done wrong here. I’ve got code that generates a query (several actually), and I simply want several of the columns hidden when it opens for viewing:
strSQL2 = “SELECT tblPhCodes” & Combo0.Value & “.*, JobProduction.* ” & _
“FROM tblPhCodes” & Combo0.Value & ” LEFT JOIN JobProduction ON tblPhCodes” & Combo0.Value & “.PhaseCode = JobProduction.PhaseCode ” & _
“ORDER BY tblPhCodes” & Combo0.Value & “.PhaseCode;”
Set qdf2 = dbs.CreateQueryDef(“UtilProduction”, strSQL2)
DoCmd.OpenQuery “UtilProduction”
dbs.QueryDefs!UtilProduction.Fields![JobProduction.PhaseCode].Properties(“ColumnHidden”) = True
dbs.QueryDefs!UtilProduction.Fields![JobProduction.PhaseCodeDescrip].Properties(“ColumnHidden”) = True
dbs.QueryDefs!UtilProduction.Fields![JobProduction.BidQty].Properties(“ColumnHidden”) = True
dbs.QueryDefs!UtilProduction.Fields![CostCode].Properties(“ColumnHidden”) = True
Some of the field names are generated with the ‘.’ in the name, but I thought the square braces would deal with that. Otherwise, I’m not sure.
Thanks in advance, and any advice is sincerely appreciated.