Listindex problem

DuMont

Registered User.
Local time
Today, 00:49
Joined
Jul 31, 2014
Messages
24
Hey Guys,

I'm having an issue with this code...

Code:
Private Sub Find_Next_Patient()
 PatientName.SetFocus
 If PatientName.ListIndex <> PatientName.ListCount - 1 Then
        PatientName.ListIndex = PatientName.ListIndex + 1
      Else
        PatientName.ListIndex = 0
      End If
 End Sub
Basically when I come to an individual in two different dbs - it only displays the first one and halts the use of the next button. Meaning...

Column 1 Column 2
DuMont, Kyle 123
DuMont, Kyle 456

It won't let me go to the next record in the list - it remains on the first one.

Is the code off/do I need to add anything to make this work?

Thanks for any help!
 
Basically when I come to an individual in two different dbs - it only displays the first one and halts the use of the next button.

It won't let me go to the next record in the list - it remains on the first one.
I don't understand what you mean by "it remains on the first one" and you've not explained what your code should be doing.
 
My apologies.

I have a column bound to a query which populates a few textboxes using the onchange event for my form.

I created this button for users to be able to go to the NEXT record in the row of the query IF the patient name is the same, but not the DB (have it sorted by patient name).

By first one I mean - first instance of name. So when I come to this (below) in the column using the next button - it wont go to DuMont, Kyle 456 - it stays on DuMont, Kyle 123 regardless of how many times I hit the button again.

Column 1 Column 2
DuMont, Kyle 123
DuMont, Kyle 456

However, if I switch the bound column to '0' - it works fine. But I don't want this as it causes problems with Report.
 
1. ListIndex + 1
2. Use the Column property with step 1 and set the Value to that.

All properties of the Listbox
 
DuMont=DuMont, which is what it is telling you. The bound column must have different values.

So you and your twin brother cannot appear together on that list, nor can the remainder of your family, if you bind the surname only.
 

Users who are viewing this thread

Back
Top Bottom