Results 1 to 4 of 4
  1. #1
    naeemahmad is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2013
    Location
    Riverside, USA
    Posts
    46

    Show or Hide textbox/Lable based on checkbox for each record

    Hi Guys,

    Im having a brain-fart.. and cant seem to remember an efficent method to accomplish this..

    I need to have a continous subform show or hide a textbox or label based on a recorsd checkbox. I cannot use the 'On Current' event becuase this is only triggered when a user clicks onto the record.

    for example:
    The database has a true/false checkbox field to show record status.
    so when the user enters (loads) the form.. each record will either show (make visible) a textbox or label that says "COMPLETED" or "PENDING"

    this needs to be done without the user having to click on each record to see the status.. hence 'On Current' even will not work for me.

    Any help / guidence to aproach this is very much appericiated!



    Thanks as always.. just dont have enough coffee in me .. yet.. to remember how I use to do this before..

    Naeem~

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Try Conditional Formatting on a textbox. You can't do Visible, but you can set the font the same as the backcolor to get the same effect.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    naeemahmad is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2013
    Location
    Riverside, USA
    Posts
    46

    Cool Solution : 'On Paint' event

    Thanks for the reply. Actually conditional formating also limits what I can do with controls..The solution I used was 'On Paint' event of the record detail itself.

    heres how I approached the issue.

    Private Sub Detail_Paint()
    If Me.MAINT_LOG_STATUS.Value = True Then
    Me.lblSTATUS.Caption = "COMPLETED"
    Else
    Me.lblSTATUS.Caption = "PENDING"
    End If
    End Sub

    Appericiate the help, but just couldnt remember how I did it before... getting to old for this! LoL

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    No problem. Using code, I'd use the detail format event, unless you're using the new Report view. If memory serves, the paint event doesn't fire in Preview or Print.
    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. Replies: 2
    Last Post: 08-21-2013, 05:30 PM
  2. Show/ hide image based on some field value
    By capitala in forum Reports
    Replies: 4
    Last Post: 04-06-2013, 10:56 AM
  3. show / hide columns based on criteria?
    By stevepcne in forum Access
    Replies: 1
    Last Post: 11-18-2011, 02:49 PM
  4. Updating record based on textbox entry
    By timmy in forum Programming
    Replies: 16
    Last Post: 04-06-2011, 12:05 AM
  5. Replies: 6
    Last Post: 02-24-2011, 03:24 PM

Tags for this Thread

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