Feedback by UserVoice

I suggest you ...

Allow VBA to set DIsplayControl on linked tables consistently

Setting the "DisplayControl" property on a field of a linked table using VBA works.

You can read the value back using VBA, even after closing, compacting and reopening the database.

Dragging the field onto a form uses the correct control.

However, the interface still shows the value "Text Box" until manually changed by the user.

Code:
With CurrentDB().TableDefs("TABLE").Fields("FIELD")
Set prp = .CreateProperty(strProperty, "DisplayControl", acComboBox)
.Properties.Append prp
Set prp = Nothing
.Properties("DisplayControl").Value = acComboBox
End With

' You can do this in the immediate window and the value is 111 (acComboBox)
Debug.Print CurrentDB().TableDefs("TABLE").Fields("FIELD").Properties("DisplayControl").Value

1 vote
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Anonymous shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    0 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base