Find record based on cascading combo box (1 Viewer)

sparklegrrl

Registered User.
Local time
Today, 03:16
Joined
Jul 10, 2003
Messages
124
Hello again!

I have a form that I created a combo box and cascading combo box on. The combo box is our customer list. The cascading combo box has parts by customer. These are working fine however, I need to find a record based on the parts selected.

I tried adding a combo box that finds a record but didn't know how to switch that to a cascading combo so I started from scratch and got it working but now I don't know how to filter.

Thanks in advance for your help and time!
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 19:16
Joined
Aug 30, 2003
Messages
36,124
Presumably the filter would get applied after the second selection. The trick would be it would likely have to use the first combo too (customer and part).
 

sparklegrrl

Registered User.
Local time
Today, 03:16
Joined
Jul 10, 2003
Messages
124
You lost me.
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 19:16
Joined
Aug 30, 2003
Messages
36,124
What was the filter that worked, and why did it fail after switching to cascading combos?
 

sparklegrrl

Registered User.
Local time
Today, 03:16
Joined
Jul 10, 2003
Messages
124
My apologies if I mispoke or didn't explain clearly. I meant that I got the cascading combo boxes working properly.

If you select the customer then that customers parts appear in the cascading box below. I need the selected part with it's details to appear in the form.


Love the Wino Moderator title btw! :p
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 19:16
Joined
Aug 30, 2003
Messages
36,124
Thanks! I figured I should own up to it. :p

If you make a stand-alone "find a record" combo, can you copy the code/macro to the cascading combo? Can you attach the db here?
 

sparklegrrl

Registered User.
Local time
Today, 03:16
Joined
Jul 10, 2003
Messages
124
Here you go...it's just the front end though.
 

Attachments

  • HUI_Main.zip
    299.3 KB · Views: 49

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 19:16
Joined
Aug 30, 2003
Messages
36,124
Well, I can't see data types or test, so will make a wild guess at code for the second combo which assumes the customer field is numeric and the part field is text:

Code:
  Dim rs As Object

  Set rs = Me.Recordset.Clone
  rs.FindFirst "CustomerID = " & Me.PARTSCOMBO.Column(0) & " AND PartNo = '" & Me.PARTSCOMBO.Column(2) & "'"
  Me.Bookmark = rs.Bookmark
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 19:16
Joined
Aug 30, 2003
Messages
36,124
Excellent! You send it, I'll drink it! Include a note telling my wife to keep her mitts off of it. :p
 

sparklegrrl

Registered User.
Local time
Today, 03:16
Joined
Jul 10, 2003
Messages
124
Ha ha ha! Will do - don't have to do that w/my honey. He hates wine. It's mine..ALL MINE! *giggles*
 

Users who are viewing this thread

Top Bottom