473,513 Members | 2,307 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

combo box search is giving runtime error 2501

30 New Member
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
3 2372
ADezii
8,834 Recognized Expert Expert
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
razjafry
30 New Member
Thanks a lot,
Its working on the base of ID now.

Raz
May 3 '08 #3
ADezii
8,834 Recognized Expert Expert
Thanks a lot,
Its working on the base of ID now.

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

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

Similar topics

1
5563
by: Bob Dydd | last post by:
Hi everyone It's me again. I have an access 2000 database with 12 landscape reports which sometimes have to be FAXED and other times printed, so I have written the following code and put it...
1
6124
by: Will | last post by:
I have a combo box on a form which is based on table tblMachine. On that combo box I have four columns visible MachineNumber, description, location and type. The bound column is the MachineNumber...
0
1202
by: Lauren Wilson | last post by:
Hi Folks, I have a combo box on a multi-record form. About every other time I select something from the STATIC list of options, I get this result: What on earth is the cause of this error...
4
9429
by: Keith | last post by:
I have the following code in the On No Data event of a report: **** On Error GoTo err_trap MsgBox "No items matching criteria.", vbInformation, gcApplication Cancel = True err_trap: If...
8
2441
by: sara | last post by:
I have a report that runs fine with data. If there is no data, I have its NO Data event sending a MsgBox and cancelling the report. Then it seems I still get the 2501 message on the Open Report...
1
1967
by: bwakefield | last post by:
Hello, I am currently working on a Stock Control database and I am trying to set a filter on the form using a combo box. At present I am using a continuous form with the combo box being placed in...
1
1928
by: Haole88 | last post by:
I am brand new to VBA - so if this is a brain-donor question...sorry!! I have a search button on my switchboard with two fields next to it - Status and Technician. I can search for both fields...
2
5012
by: dkohel | last post by:
What is wrong with the following code? I am trying to filter a form based on the selection of a combobox named cblPRD Dim currentFilter currentFilter = " = '" & Me!cboPRD & "'" Filter =...
12
4007
by: micarl | last post by:
How would i print a report based on criteria selected from several Combo Boxes as well as multiple Multi Select List Boxes, that are located on the same form? I can get one Multi List Box, just...
0
7265
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7388
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7545
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7111
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5692
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5095
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4751
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3228
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
461
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.