Limit browseable records with combobox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ezechiel
    New Member
    • Jul 2009
    • 53

    Limit browseable records with combobox

    hi,

    I have a little problem here..

    when I create a form to browse trough records, everything works fine.
    When I'm on a certain record and say, 'manufacturer' is on 'Apple' and I do a right click "filter by selection", I browse trough the records with only 'Apple' as manufacturer.

    Why can't I edit the textbox to put Apple for example and then filter? I know this is possible while in datasheet view (by selecting 'apple' and then 'filter by selection', but this shouldn't be authorized for normal users (the datasheet view).
    Or to do things better, the user could make a choice with a combobox. But the same problem occurs with that solution:

    I can't select a value in the combobox to filter the browseable records. I only can see them, not click on them. I managed to make it clickeable, I don't remeber how, but then it changes that value of the current record, and this is not an action that should be authorized of course.

    Anyone knows how to do this?
  • ezechiel
    New Member
    • Jul 2009
    • 53

    #2
    Or is this a limitation of Access?

    Comment

    • ezechiel
      New Member
      • Jul 2009
      • 53

      #3
      No one has an answer? Of is this a stupid question?? :$

      Comment

      • ChipR
        Recognized Expert Top Contributor
        • Jul 2008
        • 1289

        #4
        I'm not sure what you mean when you say you can't select a value from a combo box. If you want to use a combo box to filter your form, you could put an unbound combo box in the form header, set it's record source to the manufacturers, and add code to it's AfterUpdate event.
        Code:
        Private Sub cmbManufacturerFilter_AfterUpdate()
            Me.Filter = "Manufacturer = '" & cmbManufacturerFilter & "'"
            Me.FilterOn = True
        End Sub

        Comment

        • ezechiel
          New Member
          • Jul 2009
          • 53

          #5
          even if you didn't quite understand :p you got the answer.

          Well, with "I can't select" I mean that i can open the drop down list from the combobox, but when I click on a value from the drop down list, it is like I never clicked.. the drop down list stays open and nothing changes.

          So what I have to do is change my first combobox into a textbox (that will display the value for the current record, like other info (eg. 'serial number' or 'processor').
          And then change the form header, by placing comboboxes in there, in order to filter the 'content' of the records.

          Did I understand you right?
          For me it wasn't logic to have one object to choose a value and another one to display a value, I wanted to do both with the same object, the combobox in this case...

          Comment

          • ChipR
            Recognized Expert Top Contributor
            • Jul 2008
            • 1289

            #6
            You should be able to use a combo box to allow the user to change the value of the record in the table. Can't figure out at the moment why that would be locked and not allow you to select. Text box is fine for display though.

            But, yes, the combo for filtering is a different story, and should not be bound to your table. Filtering doesn't affect the content of the current record, though. It makes your form only display some of the records in the underlying recordset. Is that what you're going for?

            Comment

            • ezechiel
              New Member
              • Jul 2009
              • 53

              #7
              yes, it is exactly that what I'm going for! Thanks for the help, again :D

              Comment

              Working...