display results from combo/ narrow list as typed

  • Thread starter klp via AccessMonster.com
  • Start date
K

klp via AccessMonster.com

2 Questions:
1) I have 2 combo boxes on my customer maintenance form. They are
synchronized, when I select a customer number the ship to combo box displays
the shipping locations for that customer. When I select a shipping location I
would like the rest of the customer information to populate(ie, address, city,
state zip). But it does not. This is what I have so far. Both combo boxes are
unbound.

On CustID cbo
After Update - Me!cboShipTo.Requery

ShipTo cbo
AfterUpdate - DoCmd.ApplyFilter , "ShipToID = Forms!frmCustomers!cboShipToID"

On the AfterUpdate on frmCustomers - Me!cboShipToID.Requery

The combo boxes do exactly what I want but I can't get the rest of the form
to fill in once the shipto location is selected. Any ideas?

2) On combo boxes, what I want to do is narrow my results when I start typing.
I have the autoexpand set to yes. And that works, but for instance if I start
typing in a part # starting w/ P, then I want the box to show ONLY those
parts that start w/ the letter P. I don't want it to show all parts in the
combo box, there are several parts and it would be nice to narrow more. So if
the part it P001 then all parts that start w/ P001 would show ONLY. Is this
possible? I've seen it before but not sure how to dot it.
 
G

Guest

1. Change ShipTo cbo AfterUpdate
Applying the filter here means you have remove it to move to another record.
I prefere this approach which only make the record selected the current
record:

Set rst = Me.RecordsetClone
rst.FindFirst "ShipToID = Forms!frmCustomers!cboShipToID"
set Me.Bookmark = rst.Bookmark
set rst = Nothing

2. Doable, but maybe slow for a large database. The approach for this is to
use the combo box's Change event. The Change event fires every time there is
a change in the value. That means it fires on every keystroke. So, you can
requery the combo after each keystroke using the current value as the filter
which would look something like:

"[PartNumber] Like '" & Me.CustIDcbo & "*'"
Me.CustIDcbo.Requery

You can see where this could get sluggish.
 
D

DW

1st section
How many columns are you showing in the property for the combobox? You might
need to specify how many columns to use, then populate the form by using
Me.FiledOne.Value = Me.MyCombobox.Column(1) and so on in your code

2nd section
Try making a query using the table needed, set the criteria to equal your
combox, then use that query in your combobox and requery the combo upon
change.

DW
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top