more help with combo boxes

octatyan

Registered User.
Local time
Today, 04:26
Joined
Jan 10, 2003
Messages
36
Hi, I need help with another combo box.

my database has information about car manufacturerss and their id numbers:

ie
honda, ID 50-1
honda, ID 50-2
honda, ID 50-3
toyota, ID 99-1
toyota, ID 99-2

I have a form that displays each of these records. There is also a combo box that the user can open to find a record and update the information in the form based on the selection made in the combo box. This combo box, when opened, displays the car manufacturer and ID # in exactly the same fashion as above.

here is the code i am using.....

Private Sub Form_Current()

'Displays Car Manufacturer in combo box
Combo36 = CarManufacturer

Sub Combo36_AfterUpdate()
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[CarManufacturer] = '" & Me! [Combo36] & "'"
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub

Here's my problem:
no matter which selection I make in the combo box, be it honda ID50-1, honda ID50-2, honda ID50-3, the form is updated based on the honda record with the FIRST id # (honda 50-1).
Same thing happens with any toyota record.

So if I open the combo box and select honda ID50-3, the form will show the information for Honda ID50-1. Why???

How do I fix this?

Any help is GREATLY appreciated!
 
Last edited:
What is the rowsource for your combo box? What field is the bound column?

honda, ID 50-1 is the combination of the manufacturer and the id number. Your code here: Me.RecordsetClone.FindFirst "[CarManufacturer] = '" & Me! [Combo36] & "'" is searching by manufacturer only. And you are using the FindFirst command which finds the first instance of the car manufacturer. So, if you've entered records in the order you listed, you'd get exactly the results you are getting now if the combo box bound column is the car manufacturer.
 
I'm kind of a newbie. So what does all that mean? How can I change it to correct to problem?
 
octatyan,

I'll bet that you inherited this db and your combo is a multi-column
combo.

Your query is only based on column 0 (maybe).

In your form's design mode, look at the properties for your combo,
check and you've probably got more than one column.

Your query for the form should reference this in its criteria.

Post your db if this doesn't help.

Wayne
 

Users who are viewing this thread

Back
Top Bottom