Subform lookup not working

waipahunet

Registered User.
Local time
Today, 12:37
Joined
Oct 13, 2003
Messages
20
could someone help with this problem I'm having with a promotional planning form. Promoplanning (main form) and promoplanning detail (subform). Three linked fields PromoID, PrincipalCode, CustomerCode. The subform has an Item field that is a dropdown. Problem is that I'd like the dropdown to only look up the items for the PrincipalCode selected on the main form. Right now it just shows all the items. I've got this scenario on a couple of other forms. Can anyone offer any suggestions?

Thanks!
 
W-N,

Use a query as the row source of the combo. Reference the PrincipalCode textbox (Forms!FormName!TextboxName) in the criteria row of the query, under the relevant field. See "query by form" and "rowsource" and "column count" and "column widths" in Help for more details...

Regards,
Tim
 
pono1, thanks i'll give it a try.
 
hey pono1 can you offer any suggestions on this one?
I created the queries you suggested and it worked fine but now I wanted to create another subform (multiselect box) that only displayed items based on the selection from another subform. Here's what I tried so far:
#1. frm_promos (main form contains [PrinCode] field)
#2. (Datasheet format) frm_promosdetail_sf (subform contains [PrinCat] dropdown that only displays categories under the selected [PrinCode]
#3. frm_promositems_sf (subform contains [UPC] multiselect box that's supposed to only display all UPC codes for [PrinCat] selected from #2.
I inserted frm_promositems_sf as a subform to #1 and when I selected a [PrinCat] from #2, only the items under that [PrinCat] was displayed in #3. However, when I added another record to #2, it didn't update #3 with the correct items.

Hope it's not so confusing. Thanks in advance!
 
Okay, here's what I came up with but if anyone has any other suggestions please let me know. I created a macro to requery the items subform and put that as an event On Click so when they click on the items subform it now updates with the correct items.
 
Okay, here's what I came up with but if anyone has any other suggestions please let me know. I created a macro to requery the items subform and put that as an event On Click so when they click on the items subform it now updates with the correct items.
 

Users who are viewing this thread

Back
Top Bottom