Results 1 to 4 of 4
  1. #1
    TSSIn is offline Novice
    Windows 10 Office 365
    Join Date
    Jul 2020
    Posts
    3

    Programmatically change table field properties

    It is possible to change the field properties for fields in a table via code?


    I would like to change a field from a text box to a combo box. This code below does not work


    db_current.TableDefs("CTTrainingAssgnment").Fields ("8/24/2021").Properties("Display Control") = "Combo box"
    db_current.TableDefs("CTTrainingAssgnment").Fields ("8/24/2021").Properties("Row Source Type") = "Table/Query"
    db_current.TableDefs("CTTrainingAssgnment").Fields ("8/24/2021").Properties("Row Source") = "SELECT [Person].[PersonID], [Person].[FullName] FROM Person;"
    db_current.TableDefs("CTTrainingAssgnment").Fields ("8/24/2021").Properties("Bound Column") = 1
    db_current.TableDefs("CTTrainingAssgnment").Fields ("8/24/2021").Properties("Column Count") = 2
    db_current.TableDefs("CTTrainingAssgnment").Fields ("8/24/2021").Properties("Column Widths") = "0;1"

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    1. you shouldnt
    2. you shouldnt have a field called:
    "8/24/2021". dates should be values in the [EventDate] field

  3. #3
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,858
    Tables do not have combos, unless a lookup field, and generally not recommended?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Perhaps you could step back and tell us in simple English -no database jargon -about the "business" you are trying to support with this proposed database.
    As has been said,
    you shouldnt have a field called:
    "8/24/2021". dates should be values in the [EventDate] field
    Tables do not have combos
    .

    If you tell us the requirement, you're more likely to get more focused responses or design assistance.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 07-01-2017, 01:07 AM
  2. Replies: 1
    Last Post: 01-11-2015, 01:22 PM
  3. Text field refuses to change programmatically
    By kdbailey in forum Access
    Replies: 6
    Last Post: 03-08-2014, 02:32 PM
  4. Replies: 7
    Last Post: 04-23-2013, 11:57 AM
  5. Replies: 6
    Last Post: 11-14-2012, 01:06 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums