Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

won't recognize DisplayControl Property 1

Status
Not open for further replies.

jendk

Programmer
Jun 14, 2006
2
DK
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
 
jendk,
I think you need to change the [tt]Type[/tt] property before DAO will allow you to change [tt]DisplayControl[/tt] (I also added the format since I always seem to forget it).
Code:
...
afkryds.Properties("Type") = 1
afkryds.Properties("Format") = "Yes/No"
afkryds.Properties("DisplayControl") = 106
...

Hope this helps,
CMP

(GMT-07:00) Mountain Time (US & Canada)
 
Hi CautionMP

Thanks for the reply, just tried your changes, but unfortunately I now get a run-time error 3219 - Invalid action. When debugging it has stops at the first line:

afkryds.Properties("Type") = 1

hope you might recognize this problem?
 
jendk,
No idea, works fine in Access 2000 (SR-1) but I tried it in Access 2003 and got the same two errors you encountered.

I don't have any other ideas or suggestions, csorry.

CMP

(GMT-07:00) Mountain Time (US & Canada)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top