Results 1 to 5 of 5
  1. #1
    gykiang is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Nov 2013
    Posts
    47

    Update a control

    I have a simple event code for toggle button in a single form named "DisplayEXEAGAINST" with control and value to be stored in [DisplayEXEAGAINST] :

    Private Sub DisplayEXEAGAINST_Click()
    Me.BoxEXE.Visible = IIf(Me.DisplayEXEAGAINST.Value =-1, True, False)
    End Sub
    -------------------------
    Private Sub Form_Current()
    Me.BoxEXE.Visible = IIf(Me.DisplayEXEAGAINST.Value =-1, True, False)
    End Sub
    ------------------------

    The intention is to hide or unhide the record of Me.BoxEXE in every row independently.

    However, after click of the button, the same record in all the rows will change to become the same which is incorrect, i.e. the same record in all the single form be hidden or unhidden.

    Appreciate help to correct the error.



    Thanks !

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,641
    You said this is a single view form?

    Not sure what you mean by 'record of Me.BoxEXE in every row independently'. What is BoxEXE - a list box?

    If this is a single view form, why would it show multiple rows?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    gykiang is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Nov 2013
    Posts
    47
    Me.BoxEXE is just a Label field.
    Every row is a new form.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,641
    Just hiding a label won't hide an entire row.

    I still don't know what you are trying to accomplish.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    If the form control Me.DisplayEXEAGAINST is not bound to a table field, then its value will be the same for all records the form displays, and therefore the On Current event will always yield the same result (until you change the value of Me.DisplayEXEAGAINST again.

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

Similar Threads

  1. Replies: 10
    Last Post: 02-20-2013, 07:04 AM
  2. Replies: 2
    Last Post: 11-20-2012, 03:00 PM
  3. Replies: 1
    Last Post: 05-18-2011, 07:23 AM
  4. Replies: 6
    Last Post: 03-14-2011, 09:37 AM
  5. Form/Subform - Update control help!
    By f_ali in forum Forms
    Replies: 2
    Last Post: 02-26-2006, 12:59 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