Results 1 to 8 of 8
  1. #1
    tutlay is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2014
    Posts
    4

    Auto-populate a text field based on a checkbox


    Hi all -- new here and to Access 2007. I hope this post finds you well.

    I have a database with the following 2 fields: (1) Ineligible, checkbox; and (2) Active/Inactive, dropdown menu. When a participant is deemed "Ineligible", staff clicks the checkbox AND is supposed to be checking the "Inactive" option. I find that this is redundant. I'm sure there's a way to autopopulate the text box with "Inactive" when the "Ineligible" box is checked (vice versa with active/eligible).

    How can I connect these two fields to do this task automation?

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Normalization rules state that fields within a record should not be dependent on one another.

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    I agree with RG.

    If participant cannot be Active and Ineligible at same time, why bother with 2 fields? Status is either (Active and Eligible) or (Not Active and Not Eligible)? The two fields appear redundant.

    However, if you must, would require code.
    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
    tutlay is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2014
    Posts
    4
    Thank you both, RG and June7. I do recognize that this is a redundant work (so unnecessary!) but bosses want me to do that. I was thinking of another way to lessen manual work. So when a staff member checks off "Ineligible", they're supposed to uncheck the "Eligible" box -- can I auto-uncheck the "Eligible" box when the "Ineligible" box is checked? So that only one of them is checked at any given time.

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Why not use an Option Group?

  6. #6
    Xipooo's Avatar
    Xipooo is offline Sr. Database Developer
    Windows 8 Access 2013
    Join Date
    Jan 2014
    Location
    Arizona
    Posts
    332
    You could also do make it a calculated field on your table which just matches the check box value. When the checkbox is updated just do a me.requery on the table. Probably the least amount of hassle.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    Xipooo, OP shows Access 2007 which does not have Calculated field type.

    tutlay, I am confused by your last question. An option group as RG suggests is great to set value of a single field but you originally said you have two fields, one dependent on the other.
    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.

  8. #8
    Xipooo's Avatar
    Xipooo is offline Sr. Database Developer
    Windows 8 Access 2013
    Join Date
    Jan 2014
    Location
    Arizona
    Posts
    332
    Quote Originally Posted by June7 View Post
    Xipooo, OP shows Access 2007 which does not have Calculated field type.

    tutlay, I am confused by your last question. An option group as RG suggests is great to set value of a single field but you originally said you have two fields, one dependent on the other.
    Good catch. I forgot that it wasn't available in 2007. Knew it wasn't in 2003.

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

Similar Threads

  1. How to auto-populate a field based on a query on another table
    By lissy_vincent@yahoo.com in forum Forms
    Replies: 2
    Last Post: 02-17-2014, 04:08 PM
  2. Replies: 7
    Last Post: 11-28-2012, 01:41 PM
  3. Replies: 5
    Last Post: 03-07-2012, 12:57 PM
  4. Replies: 3
    Last Post: 10-03-2011, 02:33 PM
  5. Replies: 3
    Last Post: 10-05-2009, 07:22 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