also see old thread705-1110246
I am trying to change the property DisplayControl for a field in a table, but keep getting "runtime error 3207 - property not known" when running the code. Can anyone identify where I go wrong? I have no problems creating the table or identifying a field in the table, the error is only in the very last line where I try to change the property.
Thanks
Jenny
my code:
Bruger = UCase(Environ("USERNAME"))
'Creating new table using SQL
DoCmd.RunSQL "SELECT tbl_AFDELINGER_KUNDE.AFDELINGSID AS Portefølje, tbl_AFDELINGER_KUNDE.AFDELINGSNAVN AS Navn, [ÅBD_tbl_TB_afd_liste_ja/nejfelt].[JA/NEJ] INTO ÅBD_tbl_AFD_ATP_" & Bruger & " " & _
"FROM tbl_AFDELINGER_KUNDE LEFT JOIN [ÅBD_tbl_TB_afd_liste_ja/nejfelt] ON tbl_AFDELINGER_KUNDE.AFDELINGSID = [ÅBD_tbl_TB_afd_liste_ja/nejfelt].AFDELINGSID " & _
"WHERE (((tbl_AFDELINGER_KUNDE.kunde) = [forms]![vælg_afdeling2]![kunde]) or ((tbl_AFDELINGER_KUNDE.gruppe) = [forms]![vælg_afdeling2]![gruppe])) " & _
"ORDER BY tbl_AFDELINGER_KUNDE.AFDELINGSID"
Dim db As Database
Dim rs As Recordset
Dim afkryds As Field
Set db = CurrentDb
Set rs = db.OpenRecordset("table.ÅBD_tbl_AFD_ATP_" & Bruger & "")
Set afkryds = rs.Fields("JA/NEJ")
'changing field peoperty in new table
afkryds.Properties("DisplayControl") = 106
I am trying to change the property DisplayControl for a field in a table, but keep getting "runtime error 3207 - property not known" when running the code. Can anyone identify where I go wrong? I have no problems creating the table or identifying a field in the table, the error is only in the very last line where I try to change the property.
Thanks
Jenny
my code:
Bruger = UCase(Environ("USERNAME"))
'Creating new table using SQL
DoCmd.RunSQL "SELECT tbl_AFDELINGER_KUNDE.AFDELINGSID AS Portefølje, tbl_AFDELINGER_KUNDE.AFDELINGSNAVN AS Navn, [ÅBD_tbl_TB_afd_liste_ja/nejfelt].[JA/NEJ] INTO ÅBD_tbl_AFD_ATP_" & Bruger & " " & _
"FROM tbl_AFDELINGER_KUNDE LEFT JOIN [ÅBD_tbl_TB_afd_liste_ja/nejfelt] ON tbl_AFDELINGER_KUNDE.AFDELINGSID = [ÅBD_tbl_TB_afd_liste_ja/nejfelt].AFDELINGSID " & _
"WHERE (((tbl_AFDELINGER_KUNDE.kunde) = [forms]![vælg_afdeling2]![kunde]) or ((tbl_AFDELINGER_KUNDE.gruppe) = [forms]![vælg_afdeling2]![gruppe])) " & _
"ORDER BY tbl_AFDELINGER_KUNDE.AFDELINGSID"
Dim db As Database
Dim rs As Recordset
Dim afkryds As Field
Set db = CurrentDb
Set rs = db.OpenRecordset("table.ÅBD_tbl_AFD_ATP_" & Bruger & "")
Set afkryds = rs.Fields("JA/NEJ")
'changing field peoperty in new table
afkryds.Properties("DisplayControl") = 106