Selasa, 31 Januari 2012

Re: [MS_AccessPros] Combo Box Lookup

 

here's what I have

a simple recipe DB with 4 tables; tbl_Recipe, tbl_MealType,
tbl_RecipeType, tbl_Category.

the tbl_MealType, tbl_RecipeType, tbl_Category have a one to many
relationship to the tbl_Recipe, each meal type can have many recipes, etc..

If I create a form based on a query and only use the tbl_Recipe fields
that do not include the Foreign Keys to the other tables, then when I
add the combo box and I use the option "Remember the Value for later
use" I get the same data for each record in the lookup combo box.

If I use a query that includes the Foreign Keys, I get the same result.

If I create a form and base it on a query and I choose "Store Value in
Field" and I select the Foreign Key OD field, I get a "Value is not
Valid" error.

If I create a form and base it on a table and choose "Store Value in
Field", then it works.

It's obvious I doing something stupid, but can't figure it out.

Thanks,
John M.

On 1/31/2012 1:25 PM, John Viescas wrote:
>
> John-
>
> You should normally use a query as the Row Source of a combo box, but
> a table
> can work, too. Are you saying it only works using a table and does not
> using a
> query?
>
> John Viescas, author
> Microsoft Office Access 2010 Inside Out
> Microsoft Office Access 2007 Inside Out
> Building Microsoft Access Applications
> Microsoft Office Access 2003 Inside Out
> SQL Queries for Mere Mortals
> http://www.viescas.com/
> (Lahaina, HI)
>
> -----Original Message-----
> From: MS_Access_Professionals@yahoogroups.com
> <mailto:MS_Access_Professionals%40yahoogroups.com>
> [mailto:MS_Access_Professionals@yahoogroups.com
> <mailto:MS_Access_Professionals%40yahoogroups.com>] On Behalf Of yshopper
> Sent: Tuesday, January 31, 2012 10:16 AM
> To: MS_Access_Professionals@yahoogroups.com
> <mailto:MS_Access_Professionals%40yahoogroups.com>
> Subject: [MS_AccessPros] Combo Box Lookup
>
> I added a combo box to a form to use as a lookup. Why does this work
> using a
> Table instead of a Query?
>
> Thanks for any insight.
>
> John
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>

[Non-text portions of this message have been removed]

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar