Results 1 to 7 of 7
  1. #1
    Entellex is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Mar 2015
    Posts
    14

    Predefined table fields

    I am trying to find a simple method to have predefined table fields per Tab in a form



    OR

    Fill in multiple table fields per control

    IE:

    If I click a check box, option from a drop-box, or Fill in a text-box when that information gets entered into the table the results will be:

    Primary Category Sub Category #1 Sub Category #2 Input
    FOOD _____ FRUIT APPLE
    FOOD _____ VEGETABLE SPINACH





    The red will be automatically inserted based on what I chose for the "Sub Category #2" drop-down.
    The green will be what I typed in.
    Last edited by Entellex; 03-04-2015 at 01:38 PM.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,630
    How should Access 'know' that FRUIT is FOOD and not LUMBER or WHATEVER? Do you have a table that associates FRUIT with the category FOOD?
    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.

  3. #3
    Entellex is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Mar 2015
    Posts
    14
    I actually do! I have several tables with all my categories.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,630
    Why duplicate the category value between tables? If the value FRUIT is saved then the category can be retrieved by joining tables.
    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.

  5. #5
    Entellex is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Mar 2015
    Posts
    14
    The tables I have setup is just to define it. When I enter each record it will all be saved on one table inserting the predefined categories.

    This is how I need it to be setup, regardless. I just need to know how to have multiple fields filled out automatically based on what I put in when I add a new record

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,630
    Requires code to save the related data.

    Have combobox for selecting SubCategory2 include columns for the other related info. Then code in combobox AfterUpdate event can reference columns by index to save those values. Column index begins with 0.

    I use only VBA:

    Me!Category = Me.comboboxname.Column(1)

    There is macro equivalent that uses SetValue method.
    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.

  7. #7
    Entellex is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Mar 2015
    Posts
    14
    Thanks for the help!

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

Similar Threads

  1. VBA to update to predefined text where is null
    By webisti in forum Programming
    Replies: 1
    Last Post: 12-05-2012, 02:13 PM
  2. Replies: 9
    Last Post: 07-11-2012, 04:13 PM
  3. Replies: 3
    Last Post: 06-21-2012, 05:25 PM
  4. attachments to predefined directory
    By surfcaster in forum Forms
    Replies: 0
    Last Post: 03-04-2010, 02:22 PM
  5. Replies: 2
    Last Post: 01-22-2010, 03:53 PM

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