Results 1 to 8 of 8

Thread: [RESOLVED] MS ACCESS, VB6 Check boxes one or the other

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2004
    Posts
    128

    Resolved [RESOLVED] MS ACCESS, VB6 Check boxes one or the other

    I am trying to have this form on my Database to be one or the other have to be selected. IE open or closed. I want the open to automaticly be selected. (I have that set through ACCESS) but I want it if I click closed then the check goes out of open and is now on closed. Can anyone help?

  2. #2
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,024

    Re: MS ACCESS, VB6 Check boxes one or the other

    Hi!!!
    Are your checkbox designed in MS Access forms or VB 6.0 form? What are you trying to emphasize? What's the purpose of the checkboxes?


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

    Re: MS ACCESS, VB6 Check boxes one or the other

    So your saying to change the caption of the checkbox from open to close upon the check or uncheck?
    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

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

    Re: MS ACCESS, VB6 Check boxes one or the other

    Add a checkbox and delete the inner text control so its just a checkbox. Then add a label in its place and associate it with the checkbox control. Then code like this will do it.
    VB Code:
    1. Private Sub Check12_Click()
    2.     If Label14.Caption = "Open" Then
    3.         Label14.Caption = "Close"
    4.     Else
    5.         Label14.Caption = "Open"
    6.     End If
    7. End Sub
    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

    Thread Starter
    Addicted Member
    Join Date
    Dec 2004
    Posts
    128

    Re: MS ACCESS, VB6 Check boxes one or the other

    Thank you for your responce. I have 2 checkboxes that are designed in Access. What I am trying to do is when I click the closed check box the check that is in open goes away.

    Here is the situation. This is a Maintenance Ticket Program. When I create a ticket it automaticly selects the open checkbox. When this is open I can run a report and see all open tickets. When a ticket gets completed I want to be able to select closed it unchecks open so when I run the report again it will not show as open.

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Dec 2004
    Posts
    128

    Re: MS ACCESS, VB6 Check boxes one or the other

    I will be happy to post the .mbd file if anyone needs to to understand what I am trying to do.

  7. #7
    Addicted Member
    Join Date
    Jun 2002
    Location
    Brugge, Belgium
    Posts
    208

    Re: MS ACCESS, VB6 Check boxes one or the other

    This should do it

    VB Code:
    1. Private Sub chkClose_Click()
    2.   dim v as integer
    3.   if chkClose.value=-1  then
    4.       v=0
    5.   else
    6.       v=-1
    7.   end if
    8. chkOpen.value=v
    9. End Sub

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Dec 2004
    Posts
    128

    Re: MS ACCESS, VB6 Check boxes one or the other

    You all are awsome 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