Results 1 to 6 of 6
  1. #1
    aparnawangu is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jul 2015
    Posts
    40

    help regarding Combobox linking with checkboxes

    Hi
    I have designed a form and in that form i want to link combox with checkboxes.
    Actually i want that if i click a option in combobox box accordingly only related checkboxes should be displayed on form and when i will select any of the checkboxes then accordingly the values for that checkbox should reflect.


    How to do this?Pls help

  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,771
    Not clear what you are trying to do but it sounds complicated. How are checkboxes 'related' to combobox? What do you mean by 'values for that checkbox should reflect' - reflect where, in combobox?
    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
    aparnawangu is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jul 2015
    Posts
    40
    Hi,
    In combobox i am having plans for students like Accenture Infant,IBM Infant etc.
    In checkboxes i am trying to reflect the components like application fees,admission fees with values means amount.
    I am not sure whether it is possible or not.
    I want when i select a plan from combobox only the applicable components should be reflected like for Accenture Infant if only application fees is applicable then it should only reflect with amount and whether that can be reflected in checkbox or listbox or somewhere else?,pls suggest and how to connect that to my combobox.

  4. #4
    nick404's Avatar
    nick404 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2015
    Location
    Wisconsin
    Posts
    352

    Lightbulb

    Do you need inherent values to display after you check this combo box? If so, just an idea:

    Maybe have a table with the plan as the pk and all these options as fields (application fees, admission, etc.) and fill in the corresponding data (like prices). Then in your combo box data properties select the row source as table/query. Click the ... and select the table with all this info. Include every field in the query and hit save. In the format properties of the combo box keep its column count to 1 so you don't see all these options when you click the drop down. Then have textboxes for each of the possible fields and name them accordingly, i.e. txtAppFee, txtAdmissFee so you know later what they are.

    In the AfterUpdate event of the combo box (lets call it cboPlan) put code like this:
    Code:
    Sub cboPlan AfterUpdate()
    Me.txtAppFee = Me.cboPlan.Column(1) 
    Me.txtAdmissFee = Me.cboPlan.Column(2)
    Me.txtThirdThing = Me.cboPlan.Column(3)
    etc.
    End Sub
    The .Column() refers back to you query you made. Make sure you have the textbox you are filling corresponding with the correct column in your query. Include every field in your query and in your table if something does not apply to a certain plan just put something like NA in for it. Unless it is a currency then leave 0.

    This is just what I thought of, and by no means the only solution. Others may have better ideas!

  5. #5
    aparnawangu is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jul 2015
    Posts
    40
    I checked this code its not working.Pls suggest some other solution.

  6. #6
    nick404's Avatar
    nick404 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2015
    Location
    Wisconsin
    Posts
    352
    What do you mean by 'not working' ? Are you getting an error or is nothing happening after you select an item from the combo?

    For the code to work you have to include all the fields in the query builder that is responsible for sourcing the combo box. Once you do that it should work just fine- I have used it a lot. Double check what you named your textboxes and make sure you call them out correctly in the code.
    If you are unsure you can type 'Option Explicit' at the top of the code screen and it can help catch spelling mistakes.

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

Similar Threads

  1. Replies: 1
    Last Post: 01-16-2015, 09:28 AM
  2. Checkboxes ?
    By Trojnfn in forum Access
    Replies: 3
    Last Post: 09-30-2011, 01:52 PM
  3. Replies: 0
    Last Post: 03-04-2011, 10:28 AM
  4. Linking Combobox back to table
    By jlclark4 in forum Forms
    Replies: 52
    Last Post: 12-31-2010, 03:18 PM
  5. Replies: 0
    Last Post: 08-24-2010, 06:38 PM

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