View Single Post
  #5  
Old May 19th, 2010, 03:57 PM posted to microsoft.public.access.forms
BruceM via AccessMonster.com
external usenet poster
 
Posts: 448
Default help needed with a combo box

That is another way to do it, but "need to" implies it is the only way, which
is not the case. With your approach, requerying the combo box is the only
code, but when I can I prefer to avoid form and control references in queries
if for no other reason than that the query is specific to the form, and can't
be worked on unless the criteria are temporarily changed.

Also, for reasons I mentioned it would probably be best to use the same code
(whichever approach is used) in the form's Current event.

Daryl S wrote:
Alanb -

You need to set the row source for the combo box on tab 2 to be a query like
this (use your subform name that is on the first tab, or if not in a subform,
just reference the field):

SELECT [Product Code], [Item description]
FROM TblPriceList
WHERE [Supplier Name] = Forms![Frm
Suppliers].[SubformNameOnTab1].Form.[Supplier Name]

You may need to requery this combobox in the AfterUpdate event of the
Supplier Name on tab 1.

If you have problems, post your SQL or the code that is not working.

My main tables/fields are;
TblOrders

[quoted text clipped - 20 lines]

.


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201005/1