Results 1 to 8 of 8
  1. #1
    jj1 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    128

    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 current event of the form


    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

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    You cant do this for CONTINUOUS FORMS. This can only be done in SINGLE record form.
    Continuous ALL boxes get the same treatment...just different data.

    NOW a query ,using your various conditions, can give you the true/false fields and show THEM on a continuous form.

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    You can use Conditional Formatting to achieve the look you're after.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    jj1 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    128
    It's a single record form which has the check box and text boxes to be populated. How can I use the query to perform this action
    Quote Originally Posted by ranman256 View Post
    You cant do this for CONTINUOUS FORMS. This can only be done in SINGLE record form.
    Continuous ALL boxes get the same treatment...just different data.

    NOW a query ,using your various conditions, can give you the true/false fields and show THEM on a continuous form.

  5. #5
    jj1 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    128
    How can I use conditional formatting to do this. Please explain me the steps
    Quote Originally Posted by pbaldy View Post
    You can use Conditional Formatting to achieve the look you're after.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    If it's a single record form, you just need to add code to the current event to handle the changing of records.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    jj1 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    128
    Thanks it worked

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    No problem.
    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. Code Does not work
    By larabeelw in forum Access
    Replies: 11
    Last Post: 11-27-2013, 03:18 PM
  2. vba code dont work
    By mikichi in forum Programming
    Replies: 7
    Last Post: 11-12-2013, 01:59 PM
  3. VBA code used to work now it does not
    By rachello89 in forum Programming
    Replies: 9
    Last Post: 06-15-2012, 08:48 AM
  4. Replies: 1
    Last Post: 03-07-2012, 02:00 PM
  5. Word code in Access - How to modify my current code
    By Alexandre Cote in forum Programming
    Replies: 0
    Last Post: 11-15-2010, 08:26 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