Results 1 to 7 of 7
  1. #1
    MWF is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Feb 2015
    Posts
    4

    What is the name of a ComboBox when specifying it in the Display Control of a field in a table?


    I have a table with a field that has a ComboBox as an option for entering data. I did this by specifying ComboxBox in the Display Control in the Lookup tab of Field Properties. What is the name or how do I determine the name of this ComboBox? Perhaps ComboBox1 or Combo1? I need the name so I can Access the ComboBox methods in a module as I will be populating another field based on the ComboBox selection. But I need the name of the ComboBox to do this.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Most experienced Access developers and users would advise you to NOT to use that combobox option.
    see This notice

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Agree with orange.

    The 'combobox' of table field does not have a name and cannot reference it in code.

    Must build form and create combobox control on form. Give the combobox whatever name you want.

    What field do you want to populate and why? This sounds like duplication of data.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    MWF is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Feb 2015
    Posts
    4
    Ok thanks. I realize using a form is the more obvious method, but the current users are using the table view for data entry, not forms. Simplified, they are entering data into two columns: VegetationID and Description. An example data entry would be 'FOD' and 'Deciduous Forest'. Its helpful to see both the VegetationID and corresponding Description side by side when selecting. Thus, the 2 column combobox. Once the VegetationID is selected, essentially the Description has also been selected. So I was hoping to program a module (or macro or similar) that would automatically populate the Description value base on the users combobox selection of VegetationID. However it seems by your post that this is not possible to program with table view data entry. So short of using a form, I'll just using the same combobox for the Description column and the user will have to essentially combobox select twice (once to select the VegetationID and once to select the Description).

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Why even save the description? This is duplication of data between tables.

    Why do users need to see VegetationID? Is this an autonumber field in the lookup table?

    Users interacting with tables and queries is poor db design.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    MWF,
    It still isn't clear to me what exactly the users are doing and why. It sounds like they are populating a lookup/reference table.

    Users should NOT interact directly with Tables. User interface to the database should be via Form(s). With Forms you can do edits.verification/validation "behind the scenes as needed", and even provide hints/messages/colors to highlight various errors or inconsistencies.

    If you have a Lookup Table, as June and I are suggesting, instead of Lookup field in a Table definition, and you store only the
    Key of the record in the related record, you can always get the description via a query.

    If you are learning database design, I strongly recommend you work through this tutorial at RogersAccessLibrary. An hour with that tutorial is worth a few weeks or months of trial and error coding.

    Good luck with your project.

  7. #7
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by MWF View Post

    ...I realize using a form is the more obvious method, but the current users are using the table view for data entry, not forms...
    So? What they're currently doing is not a valid excuse for not doing what is correct, especially as you now need things that cannot be done directly in a Table! As you've been told, end users should never have direct access to Tables; it's dangerous for your data and grossly inflexible.

    If they're comfortable entering data in the format that a Table presents, use the Forms Wizard and create a Form in Datasheet View. You'll have the safety and flexibility of a data entry Form, and the end users won't even be able to tell the difference...what they see when entering data will be identical to what they're used to seeing!

    Linq ;0)>

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

Similar Threads

  1. Replies: 9
    Last Post: 04-18-2014, 08:51 PM
  2. Replies: 1
    Last Post: 04-26-2013, 05:30 PM
  3. Replies: 6
    Last Post: 03-14-2011, 09:37 AM
  4. Report control of a field display/no display
    By systems013 in forum Reports
    Replies: 5
    Last Post: 02-01-2010, 09:44 AM
  5. Link ComboBox to field in a table
    By DrDebate in forum Forms
    Replies: 0
    Last Post: 04-27-2007, 08:03 AM

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