Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems using combo box to find a record

Status
Not open for further replies.

bkhendershot

Programmer
Apr 28, 2003
5
US
I'm using the combo box wizard to create a simple "Find a record on my form based on the value I selected in my combo box." Trouble is, it isn't so simple. I have tried this on two different database applications on two different machines. The wizard goes through the routine fine and sets up the code fine. But all is not fine when you go to use the combo box. When I click on the combo box, it expands and the data appears exactly as I want it to. However, when I click on one of the ID numbers in that combo box to go to the specified record, it does nothing. The combo box list remains expanded, the data in the form doesn't change, and the only way I can get the list to disappear is to click away from the combo box, which again does nothing to change the form data.

So I created a small test form in one of the applications. In this test form, I created a testID field and a Name field. I entered four records. I used the form wizard to create a form based on that table (exactly as I've done with the other applications). I used the combo box wizard exactly as I had on the other two applications. Only this time, the combo box worked exactly as it was supposed to.

So I tried recreating the combo box on the desired form using the wizard again, but it still won't work. I've compared the form properties for both the test form and the desired form, they are identical. Both combo box properties are identical. And of course, the code that the wizard generates is identical with the exception of the field name.

Does anyone have any idea why this might work in one form but not in another?? My co-worker has used the wizard in an application, and had no trouble. I had him try it on one of my applications just to see if I was really missing something, but he couldn't get it to work either. Like me, he has no clue why it won't work. If anyone can help, it would GREATLY be appreciated!!
 
Recently hashed here on tek-tips...First, what is the data you are searching for?? If the data in the combo dropdown contains any special character, you may run into problems.

Next, you are looking for a record on the form, based on the selection in the combobox. Does the combo box contain data from the same source?? If not are the data type the same? You will never find a number if you are searching for a string and vice versa.

Finally, how many records are we talking about??? Although access is pretty fast, it is not instantaneous. The combobox should close after you make a selection, and if it is not, perhaps the code hasn't finished running yet. This would make it appear to not find anything, but we are talking about quite a few records required for this lag, or a problem with the query structures.

If you like, feel free to send me a zipped, stripped copy of your db to my work address below and I will hapilly take a look at your problem and find a solution.

****************************
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. (Albert Einstein)

Robert L. Johnson III
MCSA, CNA, MCP, Network+, A+
w: robert.l.johnson.iii@citigroup.com
h: wildmage@tampabay.rr.com
 
Thanks for the very quick reply, but I actually figured it out as soon as I posted that. My form is such that I want the user to be able to look at customer information, but I don't want the user to be able to edit any of the fields without clicking a button to do so. Well, apparently the form property "AllowEdits" not only affects editing a field, but it also affects how a combo box works. This never occured to me earlier when I was checking the form properties, and I'm not sure why it didn't. But as soon as I changed the property, the combo box worked like a charm!

I had briefly considered the possibility that it might just be taking a moment, but for the data I'm using right now, there are only 16 records in it, and my co-worker's app had about 500 records in it and his worked fine.

Thanks again for the quick response!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top