Combo box issue

Zatatat

New member
Local time
Today, 11:37
Joined
Jan 10, 2012
Messages
6
Hello all,

I have a form with a subform and combo boxes in the subform that are not working properly. My issue is that when I select an ItemNo I will get the correct list of PONo's in the PONo combo box, but after selecting the correct PONo, all the previous PONo records will get the same PONo I just selected. I need to be able to select a PONo for the current ItemNo and keep the previous records intact.

Main form: ShippingOrderForm, Subform: ShippingOrderDetailsForm
My table is PurchaseOrderODetails, the fields are PONo, ItemNo, BatchNo, Pallets, Weight, QtyRec

1st combo: ItemNo (record source: SELECT DISTINCT qry_ItemByBatch.ItemNo FROM qry_ItemByBatch ORDER BY qry_ItemByBatch.ItemNo; ) (Private Sub ItemNo_AfterUpdate()
Me.PONo.Requery End Sub)

2nd combo PONo (record source: SELECT DISTINCT [PONo] FROM PurchaseOrderODetails WHERE ((PurchaseOrderODetails.ItemNo)=Forms!ShippingOrde rForm!ShippingOrderDetailsForm.Form!ItemNo); )

Thanks in advance for your help.
 

Attachments

I've not looked at your DB; However what you describe is the typical behaviour of an unbound object on a continuous form, where that object is displaying data relevant to the currently select record. Given that on a continuous form only one record can have focus at a time, in any unbound object of this type, all instances of that object will display the data relevant to the record that currently holds focus.
 
To use cascading combos in a continuous form or datasheet is quite tricky. The second combo must still be able to display all the values of its control source in ALL the records. But it cannot,when you filter it by the value set in the first combo. Depending on the exact needs one can do some fiddling. I think Galaxiom mentioned a link to workaround in one of his posts, you'll have to search for it. try various combinations of "combo" and "continuous" or "datasheet"

I am not sure how Galaxiom's reference worked. When I had to do something like this, I made all (ie the unfiltered values) available for display, but only the ones determined by the filter selectable
 
John, I'm not sure I understand your recommendation. Could you plz clarify?

spikepl, I will be looking for Galaxiom's reference. Thanks for the tip.
 
I changed the control source to select the PONo (it's bound now) and kept the row source and it is working now.

Thanks John and spikepl
 
I was off and JBB was right - sorry for leading you astray:(
 

Users who are viewing this thread

Back
Top Bottom