Forum Discussion
Access combo box
My combo box on my navigation page won't pull the records for the items I select from the drop down. It instead will go through the records sequentially going from one item to the next rather than allowing me to skip to records for item number 926
From the final picture in your screen shot, it would appear that a sub was possibly lost and not replaced. You need to find the sub called "Combo32_AfterUpDate()" and restore it. If it was lost, go to the most recent backup before the crash.
But that brings up another factor. I am assuming, of course, you have a backup protocol in place and that you do have available backups. If not, today is the best time start doing that.
Also, it matters a lot if your relational database application is properly split into an accdb containing only the interface objects (forms, reports, VBA and queries) and an accdb containing only the data, in tables.
If that's not already in place, do that as soon as you set up back ups. Maybe before doing that even.
Users get only a copy of the interface (usually referred to as the Front End or FE) on their own computer. That way, if one of them biffs their copy, you just replace it from the Master copy which you keep safe. All of the FEs connect to one accdb (usually referred to as the Back End or BE) in a shared folder on your network to which all users have proper read/write/delete rights.
As noted, though, there should be code behind the After Update event that selects the proper records as you wish.
- arnel_gpSteel Contributorwhat code do you have on the combo? can you post?
- NathanArreolaCopper Contributorarnel see update below
- George_HepworthSilver Contributor
Keep in mind that the only thing we can know about this form and combo box is the information you share in your post. To that end, we need enough detail and context to work with. As Arnel asked, the code that runs on the After Update event of the combo box is the minimum amount of information needed.
It's not clear, though, what it means to say that it goes through records sequentially, rather than skipping. Please explain that in a way which allows us to visualize the actual process.
- NathanArreolaCopper Contributor
Hey George
Sorry I have very little experience with access so I wasn't sure how much to include.
For a little bit more background on my situation, the other day my entire file crashed and deleted all of my macros and interactive procedures while maintaining the data stored in that file. I have managed to reconstruct everything so that way the entire database is usable except this one combo box. The purpose of this combo box is to search through thousands of equipment records and pull those specific to the unique equipment ID typed in or selected from the drop down. The error that I mentioned is that when I put a unique ID into the drop down it will not pull those records rather the records for the next sequentially ordered piece of equipment documents. For example I open up this equipment window by default it displays the record for equipment number 1 I then type in equipment number 926 or choose it from the drop down and hit enter. The page refreshes but instead of pulling records for 926 it pulls records for number 2 if I repeat the process it goes to number three and so on. I've attached pictures to show the properties pages and the coding view as well.
The funny thing too is I have an outdated back up that works completely fine but is missing hundreds or thousands of records so I can't simply switch over. When I go into design view for that files combo box the properties sheet for each are identical so I cannot for the life of me figure this issue out.
Let me know if you need any other information
- George_HepworthSilver Contributor
From the final picture in your screen shot, it would appear that a sub was possibly lost and not replaced. You need to find the sub called "Combo32_AfterUpDate()" and restore it. If it was lost, go to the most recent backup before the crash.
But that brings up another factor. I am assuming, of course, you have a backup protocol in place and that you do have available backups. If not, today is the best time start doing that.
Also, it matters a lot if your relational database application is properly split into an accdb containing only the interface objects (forms, reports, VBA and queries) and an accdb containing only the data, in tables.
If that's not already in place, do that as soon as you set up back ups. Maybe before doing that even.
Users get only a copy of the interface (usually referred to as the Front End or FE) on their own computer. That way, if one of them biffs their copy, you just replace it from the Master copy which you keep safe. All of the FEs connect to one accdb (usually referred to as the Back End or BE) in a shared folder on your network to which all users have proper read/write/delete rights.
As noted, though, there should be code behind the After Update event that selects the proper records as you wish.