Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2012
    Posts
    14

    Red face Unanswered: Uncheck checkbox if another is checked - why doesn't it work?

    I think I need to read some more books because i'm sure this SHOULD be very simple

    The code is:

    Private Sub Form_AfterUpdate()
    If Me.actioned_resubmit = True Then
    Me.resubmit = False and req_date = date
    End If
    End Sub

    When the user clicks the yes/no field called actioned_resubmit I want Access to clear the checkbox called resubmit.. and the date in the req_date should change to today's date...now got the checkboxes working but the date isn't updating!!
    How much patience do you need to do programming?!!!!!
    Last edited by tcstrainer; 02-14-12 at 11:24.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    the after update event triggers after the row is updated, so that may be part of the problem. Im guessing you'd want to toggle this at the time either button was clicked

    another possibility is that the Access runtime hasn't recognised that the event needs to be handled... select the control and look at the properties (right click) and check the events that are selected.

    also I don't think your code is doing what you think it is
    Me.resubmit = False and req_date = date
    frankly is garbage. I don't know how the runtime will handle that

    Code:
    If Me.actioned_resubmit = True Then
      Me.resubmit = False
      req_date = date()
    End If
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    This should do what you've given as your goal:
    Code:
    Private Sub actioned_resubmit_AfterUpdate()
    If Me.actioned_resubmit = True Then
      Me.resubmit = False
      Me.req_date = Date
    End If
    End Sub
    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  4. #4
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Sorry about stepping on Healdem's toes! Got interrupted mid-response by my hound and didn't see his!
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  5. #5
    Join Date
    Jan 2012
    Posts
    14

    Thank you

    Thanks - it was obviously the 'and' that I put in that caused the problem.
    Much appreciated you taking the time to help - thanks again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •