Results 1 to 2 of 2
  1. #1
    excellenthelp is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Mar 2014
    Posts
    93

    Update Checkbox Value with IF statement

    Hello Accessers,

    What is the correct way to update the checkbox value in a table with an IF statement?

    Desired Result:
    Check if UserID is not 'ME'


    If it is not 'ME' then uncheck the box in the table.

    My current faulty code below:
    Code:
            
            NoUser = DLookup("[UserID]", "[TABLE]")        If NoUser <> "ME" Then
                [AllowLogin] = 0
            End If
    I am sure this is very simple to solve... I might need a gallon of coffee.

    Thanks!

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    For starters, without a criteria your DLookup() will always return the first record in the table:

    DLookup Usage Samples
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. How to update checkbox for record using vba.
    By behnam in forum Programming
    Replies: 3
    Last Post: 06-02-2014, 01:11 PM
  2. Replies: 6
    Last Post: 05-16-2014, 07:26 AM
  3. Replies: 13
    Last Post: 12-10-2012, 03:30 PM
  4. Multi Update By Checkbox
    By Nsquared in forum Forms
    Replies: 3
    Last Post: 02-10-2010, 03:08 PM
  5. Checkbox to update value
    By Wrangler in forum Forms
    Replies: 1
    Last Post: 01-03-2006, 06:34 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