Results 1 to 5 of 5
  1. #1
    Mahendra1000 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2013
    Posts
    101

    Question Creation of a Drag Box

    Hello,

    I have multiple search boxes in my form like Name, Pages, Year, Email, University etc....

    Instead of displaying all the search boxes with the names I wanted to create a dragbox for those search boxes.

    Dragbox (Should contain all the names of the search boxes)

    If we select "Name" in DragBox then we can search for Name

    If we need to add another DragBox. Then there should be a button named "Add Another Filter". If we click on this button then another dragbox needs to be displayed and this time we can select "University" and search for the relevant records.

    I don't know how to do this. Can any one help me out in doing this or else just ping me out with a relevant video on this please.....

    Let me know if you are not clear with my requirements.



    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,771
    This is managing the Visible property of controls. I doubt you will find any example of what you describe. How will the button 'know' which combobox you want to make available? Could use a combobox to select the field name and reveal the associated combobox.

    The 'master' combobox (you called drag box) would have properties like:
    RowSourceType: Value List
    RowSource: Name;Add Another Filter;University

    Code in that combobox AfterUpdate event like:

    Select Case Me.cbxMaster
    Case "Name"
    Me.cbxName.Visible = True
    Case "Add Another Filter"
    Me.cbxFilter.Visible = True
    Case "University"
    Me.cbxFilter.Visible = True
    End Select
    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
    Mahendra1000 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2013
    Posts
    101
    Quote Originally Posted by June7 View Post
    This is managing the Visible property of controls. I doubt you will find any example of what you describe. How will the button 'know' which combobox you want to make available? Could use a combobox to select the field name and reveal the associated combobox.

    The 'master' combobox (you called drag box) would have properties like:
    RowSourceType: Value List
    RowSource: Name;Add Another Filter;University

    Code in that combobox AfterUpdate event like:

    Select Case Me.cbxMaster
    Case "Name"
    Me.cbxName.Visible = True
    Case "Add Another Filter"
    Me.cbxFilter.Visible = True
    Case "University"
    Me.cbxUniversity.Visible = True
    End Select
    thanks for your reply.

    working on this now.

    will get back to you if i need any assistance from your end.
    Last edited by June7; 10-11-2013 at 12:23 PM.

  4. #4
    Mahendra1000 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2013
    Posts
    101
    Hello June 7,

    I was unable to bound the text box with those dragbox.... could you kindly help me out.

    Kindly have a look into the attached file.

    Open MFORM. I designed drag box and the text box at the right end.

    I just need one search button too at the bottom of my dragbox.

    If I select Authors in the drag box and entered "ABC" in text box and then press on enter should return all the Authors which contains "ABC"

    help me out.
    Attached Files Attached Files

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    The code is not in the combobox AfterUpdate event procedure. You have it in a Sub called Master but the combobox is named cbxMaster. Also, you don't have controls named cbxFilter, cbxUniversity, cbxName. Those were just examples in my suggestion. Have to use your names. In fact, you don't have comboboxes at all, just texboxes. You described wanting to display comboboxes. Where are those comboboxes and why have you added another textbox?

    If you instead want one combobox, one textbox, one button, code behind button like:

    Me.Filter = """[" & Me.Comboboxname & "] LIKE '*" & Me.textboxname & "*'"""
    Me.FilterOn = True

    Good practice to give meaningful names to things, instead of just Command23 something like btnSearch.
    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.

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

Similar Threads

  1. Replies: 8
    Last Post: 07-18-2013, 01:52 PM
  2. Drag text from Forms
    By imran688 in forum Forms
    Replies: 2
    Last Post: 10-31-2012, 01:33 PM
  3. Drag and Drop into Textbox
    By jagvent in forum Forms
    Replies: 1
    Last Post: 12-20-2010, 09:31 AM
  4. Drag and Drop Between Textboxes. Please Help!
    By kcpope in forum Programming
    Replies: 2
    Last Post: 10-19-2010, 05:03 PM
  5. Drag N Drop example between 2 listboxes
    By pkstormy in forum Code Repository
    Replies: 0
    Last Post: 08-30-2010, 10:10 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