Combo Box Will Not Move to the Next Record

mary10k

Registered User.
Local time
Today, 09:36
Joined
Jan 20, 2015
Messages
13
Hello,

I have a combo box on a form which displays records on a form based on the value I selected from the combo box (first and last name).

My issue is, the combo box will not allow me to select the next last name within that same alphabet selection. My table is indexed on the last name field alphabetically, duplicates allowed. For example, if I select Mary Jones, the form populates with her information. If I then try to select Nancy Jones (the next record in the table), it won't return the records for Nancy, but if I move to another last name such as Price, the form will populate with the information for Price.

Any suggestions how I can move to the next record using a combo box?

Thank you,
 
Either the form is locked, or the combo box is locked.
 
It sounds like he doesn't use any kind of unique identifier, either in the table or the combo box. That would play merry Hell with doing this, too.
 
The row source is the first and last name. Could you please explain how I would make it use a unique identifier? I have a unique field in my DB (NPI) that I can use as the control source, but I need the first and last name to display.

How do I tell if the form or the combo box is locked? I'm new at Access, so I appreciate any help you can provide.
 
I have a unique field in my DB (NPI) that I can use as the control source, but I need the first and last name to display.

To do this you would have the rowsource of the combo to include the fields - NPI,FirstName,LastName.

you then set the column count of the combobox to 3 and the column widths to 0;1;1. this would hide the 1st column(NPI) and show the next 2.

you can then use the findfirst method using the unique index.
 
For most searches, I'd suggest NPI, last name, first name as the column order so that the user can start typing in the last name (or even just two columns using NPI and a concatenated name so it appears like "Frothingslosh, Ichabod", since the NPI is all that really matters).

Other than that, what moke123 said.
 
I've tried your suggestion and listed this code on the on click event:

DoCmd.GoToRecord , , acNext

I am getting an error saying "GoToRecord isn't available now". I get the same when I try GoToNext or First.

Any suggestions?
 
we gotta backup. your initial description led me to think you were using the combobox to find records on your form. i assumed you were using the combobox wizard and selected the "find a record on my form" option.
perhaps you can describe exactly what you are doing or post a sample of your DB. With a combobox you would normally use the afterupdate event to run any code so i'm a little confused.
 
Thank you Moke123. I am trying to accomplish exactly as you mentioned in your post. I created a combo box by selecting the 3rd option and I was expecting it to display the details for the person I selected.

There are a lot of records with the same last name, with the NPI being the unique identifier. If I select the first iteration of 'Jones', the details display, then if I select the second 'Jones' in the combo box, nothing happens. The form just freezes.

Unfortunately, this site won't let me upload a file as I don't have a key.

Any suggestions?
Thanks.
 
I put the selection in a pop-up form before the data screen and filter the latter using the selection from the pop-up and have a Another Selection to go back and open the pop-up (which is hidden).

Simon
 
The Combobox Wizard uses FindFirst for this, and it does just that...finds the first instance of that Last Name and returns that Record! If the searched Field is the Last Name, regardless of whether you click on Mary Jones, Nancy Jones or Zirkle Jones, it will always return Mary Jones, the first Jones, alphabetically, in the Table! As the Michigander suggested, you need to be searching on a Field that is unique to a given Record, for this to work.

Linq ;0)>
 
the Michigander

I've been called a lot of things, ranging from Yankee to Liberal Traitor to Troll (it's a Michigan thing, something the Yoopers call the rest of us), but I do believe this is the first time I have been referred to as just 'the Michigander'. :)
 
Glad to add to your nicknames! I understand Merriam-Webster finally added 'yooper' to their dictionary, after much lobbying by someone from the Upper Peninsular!

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom