Results 1 to 4 of 4
  1. #1
    Join Date
    May 2014
    Posts
    98

    Unanswered: Want the code to work for current record

    I am using the code below. I have a form where I have a check box "WasIssueresolved" which if checked or is true should populate today's date in the closedate text box and at same time populate the name of the person signing in. Code works perfect. What I want to do is I want code to work only on the current record. What's happening currently is that when I put "WasIssueresolved" as False then closedate text box becomes hidden but for all records. This is what I don't want. Let me know if I am clearly stating my problem. I am learning how to state it .

    I know about the on current event but I already have some code on the form current event.


    Code:
    Private Sub WasIssueResolved_Click()
    'On Error Resume Next
    If WasIssueResolved = True Then
         Forms!Ucondition!CloseDate.Visible = True
         Forms!UCondition!CloseDate = Date
         CloseDate.Locked = True
         PersonClosingtheIssue = Me.txtUsername
         PersonClosingtheIssue.Locked = True
    
        Else
            If WasIssueResolved = False Then
            Forms!UCondition!CloseDate.Visible = False
            Forms!UCondition!CloseDate = Null
            CloseDate.Locked = False
            PersonClosingtheIssue = Null
            PersonClosingtheIssue.Locked = False
         End If
        End If
    
    End Sub
    Last edited by jj2; 04-22-15 at 14:10.

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    When you cross post, you should post the answer you found:

    http://www.excelguru.ca/node/7

    For others, the solution was to add code to the current event (form is single record).
    Paul

  3. #3
    Join Date
    May 2014
    Posts
    24
    I was wondering if this thread was resolved already? I am also doing the same for my recent project.

  4. #4
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Did you miss:

    Quote Originally Posted by pbaldy View Post
    the solution was to add code to the current event (form is single record).
    Paul

Posting Permissions

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