Results 1 to 6 of 6
  1. #1
    dubay013 is offline Novice
    Windows 10 Access 2013 32bit
    Join Date
    Sep 2017
    Posts
    8

    Switching check box's

    I posted a thread earlier this week about check box's in access. Basically, we have the checkbox's representing a negative when checked when they really mean a positive (yes). My coworker would like to fix the problem entirely by switching all the checkboxes. So, all the boxes that are currently checked need to be unchecked and visa versa.



    Does anyone know how to do this?
    Thanks much!
    Jenny

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    make the check boxes indicate Negative by check for < 0 in field value in the property:
    checkbox .controlsource = [field]<0
    then it will show TRUE if negative.

    or
    if they boxes are connected to a field,: true (yes, -1) is checked.
    0 ,false,no = unchecked.
    run a query update this field.

  3. #3
    dubay013 is offline Novice
    Windows 10 Access 2013 32bit
    Join Date
    Sep 2017
    Posts
    8
    Thanks for responding ranman256 but not sure I know what you mean.

    The boxes are connected to a field. By checking the box you are indicating if a survey station was sampled or not. Right now we have it set up that if you check the box you did not survey the point, so it is backwards kind of. We would like to flip all the existing boxes to their opposite. So right now in our database a checked box = not sampled = -1 and visa versa. We would like to make the statement agreeable by switching all the past checked boxes to checked box = sampled = -1

    Does that make more sense?

    Thanks,
    Jenny

  4. #4
    Join Date
    Apr 2017
    Posts
    1,776
    Run a query

    Code:
    UPDATE YourTable
    SET YourSampledField = Not YourSampledField

  5. #5
    dubay013 is offline Novice
    Windows 10 Access 2013 32bit
    Join Date
    Sep 2017
    Posts
    8
    I think I can create a new field then just put in a default value expression to switch the checked boxes and delete the old field. I just don't know what the code would be for the expression builder :/

  6. #6
    Micron is offline Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,372
    I agree with the answer given, but since you're at the novice level, you should do this on a copy of your table first, just in case you make a mistake.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Switching between multiple databases
    By developer11 in forum Access
    Replies: 2
    Last Post: 11-16-2020, 05:56 AM
  2. Form not switching between subforms
    By newtoaccess2 in forum Forms
    Replies: 9
    Last Post: 08-24-2014, 09:03 PM
  3. Switching to number from text
    By ChristopherL in forum Access
    Replies: 2
    Last Post: 07-01-2013, 03:27 AM
  4. Switching backend mdb
    By GraeagleBill in forum Programming
    Replies: 18
    Last Post: 03-23-2013, 03:19 PM
  5. switching int/double
    By giladweil in forum Access
    Replies: 2
    Last Post: 07-05-2010, 01:13 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