Find Correct Record with multiple key

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • redman08
    New Member
    • Dec 2008
    • 34

    Find Correct Record with multiple key

    I have a problem as follows:I have a form, with fields to edit. The data is keyed on a 'text identifier', which is entered and then used. I then determine if there are multiple occurrences of the that key (it's annoying, but possible).The single occurrence of the 'text identifier' is no problem - at the moment. If there are multiple occurrences, I use a combo to select which date the user wants. I then try and select the correct record using 'text identifier' + Date.

    This is where I am having trouble. I have tried 'filtering' and 'find record', but get various issues with null data being returned.

    I'm sure there must be a simple efficient way of achieving this.

    Many thanks in advance.
  • nico5038
    Recognized Expert Specialist
    • Nov 2006
    • 3080

    #2
    I would change the textfield into a combobox and use cascading combo's (Check: http://bytes.com/topic/access/insigh...mbo-list-boxes)
    You could check after the first field has been selected or there's no data for the second combo and proceed directly.

    Nic;o)

    Comment

    • redman08
      New Member
      • Dec 2008
      • 34

      #3
      Thanks for that. The reason why I used a textbox and not a combo for the first key was that there will be thousands of records to choose from initially.

      But, if that's the only/best way, then I'll have ago.

      Thanks again.

      Comment

      • nico5038
        Recognized Expert Specialist
        • Nov 2006
        • 3080

        #4
        The advantage of the combo box is the "auto append" feature. When typing a code Access will append the first matching number. Just give it a try :-)

        Nic;o)

        Comment

        • redman08
          New Member
          • Dec 2008
          • 34

          #5
          Have tried your approach, and linking the combos is fine (this wasn't a problem anyway). Once I select the date (on the second combo), I still get 'null' data coming through, as it doesn't appear to be able to fix onto a record with the 'identifier' plus 'date' put together as a search key. Again I've tried (in 'date_combo' afterupdate) to use filter, or similar.

          Comment

          • nico5038
            Recognized Expert Specialist
            • Nov 2006
            • 3080

            #6
            How does your filter gets constructed ?
            Be sure that the date needs to be embedded in #'s and strings (when your code is a text field) in single quotes.

            Nic;o)

            Comment

            • redman08
              New Member
              • Dec 2008
              • 34

              #7
              Thanks Nic.

              Problem solved.

              I'd assumed that the date returned in the combo didn't need to have "#" surrounding it - but it did!

              Many thanks again.

              Comment

              • nico5038
                Recognized Expert Specialist
                • Nov 2006
                • 3080

                #8
                No thanks needed, glad I could help and success with your application !

                Nic;o)

                Comment

                Working...