Results 1 to 5 of 5

Thread: Continuous form checkbox & textbox

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950

    Resolved Continuous form checkbox & textbox

    On a continuous form in Access 2000, there is a checkbox and a textbox. When I click the checkbox, I want the associated textbox to change backcolor to red. (this is actually a problem I'm trying to solve for a co-worker) However, it changes all the textboxes to red (there could be 1 - 50 check & textboxes). Of course, there's only one in design mode. The code goes like this:
    Code:
    if me!chkQT.checked then
       me!txtQT.backcolor = lngRed
    else
       me!txtQT.Backcolor = lngWhite
    end if
    How can I get just the one textbox to change color? Thanks.
    Last edited by salvelinus; Dec 10th, 2004 at 08:38 AM.
    Tengo mas preguntas que contestas

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Continuous form checkbox & textbox

    salvelinus, I duplicated your issue and t would appear that when a form is in "Continuous" form style it creates multiple instances of the controls.

    So when you change the Back Color property for the control your actually changing the parent control, so to speak. The trick will be to find a way to gain access to an indivdule instance of the textbox. I will keep looking into this and let you know what I find.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950

    Resolved Re: Continuous form checkbox & textbox

    It seems like this would be a control array issue in vb6, maybe a dynamically created one, but I don't know how to approach this in vba. My ideas had to do with setting the tag property or tabindex. This seems like it should be a no-brainer.
    My co-worker believes he's found a fix using conditional formatting, but I haven't seen what he did and am unfamiliar with that in Access, only know of it in Excel.
    Thanks for looking into this RobDog.

    Edit:
    He used conditional formatting on the Access menubar. Why it wouldn't work in code I don't know.
    Last edited by salvelinus; Dec 9th, 2004 at 11:33 AM.
    Tengo mas preguntas que contestas

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Continuous form checkbox & textbox

    Ok, I will look at CF in code.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5
    New Member
    Join Date
    Dec 2004
    Posts
    1

    Re: Continuous form checkbox & textbox

    I am having a similar problem. I have two columns of checkboxes (really only 2 checkboxes in design view)
    When one is checked I want the correspoding one to be checked to. The problem is that it only works for the first one in the column and not for all the corresponding ones.
    The following is my code:

    Private Sub Check21_Click()
    Me.Requery

    If Me.Check21 = True Then Me.Check19 = True
    If Me.Check21 = False Then Me.Check19 = False
    End Sub

    Did you ever solve this?
    Thanks!

Posting Permissions

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



Click Here to Expand Forum to Full Width