Cascading Error for Same Last Name

andysgirl8800

Registered User.
Local time
Today, 13:12
Joined
Mar 28, 2005
Messages
166
This ought to be an easy one, and I had it figured out in the past, but I can't remember what I did before. I've tried so use the forum search, so I wouldn't have to bother anyone with this, but I can't seem to word my serch criteria properly.
I have a cascading combo box for doctor's names that will auto fill 7 other fields (contact info), based on its selection. It works very well, until I have a doctor with the same last name as another doctor, say, Dr. Mary Jones, and Dr. Henry Jones. The list is sorted alphabetically, so Henry Jones is first. His information populates exactly as it should, when selected from the list. However, when I select Mary Jones, only HENRY's information displays in the 7 corresponding fields. What's wrong here?
 
You are doing a FindFirst on the name and not a unique ID number for the Doctor.
 
I'm not sure I understand...is this one of the field properties, table properties, or query properties? How do I change it?
 
I'm referring to the code in the AfterUpdate event of your ComboBox. Do your Doctor records have an ID field that is unique? If not then you will need to search on First and Last name, which might still get you in trouble on occasion.
 
Thank you for your reply. I don't have any code in the afterupdate event...not sure I ever did.
 
How are you cascading the ComboBoxes? Maybe you could post a stripped down version of the db that demonstrates the problem.
 
I have it set up very simply, without any coding. I have the MDLastName field as a cascading combo box, bound to a query (qryProviderDir) containing all the necessary data (last name, first name, credential, address, city, state, zip, and fax), total of 8 fields. I've given the field a column count of 8, and the column widths are all "0" except for column one, to display the last name. The 7 following fields have the control source set to MDLastName=Column (2), =Column(3), etc., so that choosing an MD last name will auto-populate the other 7 fields with the appropriate data. I'm thinking the error must have something to do with the query that MDLastName is dependent on....maybe disallowing duplicate alst names or something, but I can't seem to find the issue.
 
You *do* know that the column index is a zero based index and you reference the 1st column with Column(0) right? It seems like it would be easier to bind your form to the MD query and the controls to the field you like and then use the wizard to create a ComboBox to move to the record you want.

By the way, Cascading ComboBox is an idea and not an object. It is simply a way to group a selection with more than one ComboBox.
 
Last edited:
Thank you. I DID know that, but had forgotten. 7 months of pregnancy makes one rather forgetful from time to time. I had neglected to include the ID field in the query. I've added it now and adjusted my column designations and it's now working splendidly! Thank you for that refresher RG!
 
We all could use a little refresher every now and again. Glad you got it working.
 

Users who are viewing this thread

Back
Top Bottom