By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,504 Members | 2,318 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,504 IT Pros & Developers. It's quick & easy.

combo box search is giving runtime error 2501

P: 30
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

http://bytes.com/forum/thread757878.html

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 "intContactID" 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
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenForm "frmContactFull", acNormal, , "[intContactID]= '" & Me![Combo60] & "'"
Please help me out as this is bothering me a lot since quite long.
Regards,
May 2 '08 #1
Share this Question
Share on Google+
3 Replies


ADezii
Expert 5K+
P: 8,597
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

http://bytes.com/forum/thread757878.html

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 "intContactID" 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,
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenForm "frmContactFull", acNormal, , "[<ID Field Name>]= " & Me![Combo60]
May 3 '08 #2

P: 30
Thanks a lot,
Its working on the base of ID now.

Raz
May 3 '08 #3

ADezii
Expert 5K+
P: 8,597
Thanks a lot,
Its working on the base of ID now.

Raz
You are quite welcome.
May 4 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.