combo box search is giving runtime error 2501

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • razjafry
    New Member
    • Sep 2007
    • 30

    combo box search is giving runtime error 2501

    Hi,
    I am trying to create a combo box to search record on the base of ID but it gives runtime error message 2501 "the openform action was cancelled" all the times.
    I posted this question before but remained unresolved for ID search criteria



    I changed the data source from table to query but still with same result.
    Right now select criteria on the base of last name is working fine but the problem is if the list has more than one same last name, it takes me to the very first record of that last name on next form with detailed info but at the bottom filter shows more than on record of that last name and one need to scroll through that filter to get to the desired record.
    In one instance we have 38 same last name enteries which makes it impractical
    to search through filtered results.
    I am using "intContact ID" and "strLName" in the combo box with column 1 as bound. Then in the Format I make it like 0";1" . Then in the After Update event I have this code
    Code:
    DoCmd.OpenForm "frmContactFull", acNormal, , "[intContactID]= '" & Me![Combo60] & "'"
    Please help me out as this is bothering me a lot since quite long.
    Regards,
    Last edited by Stewart Ross; May 2 '08, 07:04 PM. Reason: hyperlinked thread link
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    Originally posted by razjafry
    Hi,
    I am trying to create a combo box to search record on the base of ID but it gives runtime error message 2501 "the openform action was cancelled" all the times.
    I posted this question before but remained unresolved for ID search criteria



    I changed the data source from table to query but still with same result.
    Right now select criteria on the base of last name is working fine but the problem is if the list has more than one same last name, it takes me to the very first record of that last name on next form with detailed info but at the bottom filter shows more than on record of that last name and one need to scroll through that filter to get to the desired record.
    In one instance we have 38 same last name enteries which makes it impractical
    to search through filtered results.
    I am using "intContact ID" and "strLName" in the combo box with column 1 as bound. Then in the Format I make it like 0";1" . Then in the After Update event I have this code
    DoCmd.OpenForm "frmContactFull ", acNormal, , "[intContactID]= '" & Me![Combo60] & "'"

    Please help me out as this is bothering me a lot since quite long.
    Regards,
    [CODE=vb]
    DoCmd.OpenForm "frmContactFull ", acNormal, , "[<ID Field Name>]= " & Me![Combo60][/CODE]

    Comment

    • razjafry
      New Member
      • Sep 2007
      • 30

      #3
      Thanks a lot,
      Its working on the base of ID now.

      Raz

      Comment

      • ADezii
        Recognized Expert Expert
        • Apr 2006
        • 8834

        #4
        Originally posted by razjafry
        Thanks a lot,
        Its working on the base of ID now.

        Raz
        You are quite welcome.

        Comment

        Working...