通过下拉菜单选择链接多个不相关的表单 [英] Link multiple, unrelated forms through drop down menu selection

查看:51
本文介绍了通过下拉菜单选择链接多个不相关的表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好。我正在创建一个新的数据库,从头开始打砖墙。 

Hi there. I'm creating a new database from scratch and hit a brick wall. 

我正在尝试为多个国家/地区列出项目,并且每个国家/地区都有3种不同类型的广告资源这需要彼此分开。 

I'm trying to inventory items for multiple countries, and each of these countries has 3 different types of inventory that needs to be separate from each other. 

看起来像这样:

安哥拉 - 类型1

             输入2

             Type 2

             类型3

             Type 3

贝宁 - 类型1

           输入2

            Type 2

           类型3

            Type 3

喀麦隆 - 类型1

                 输入2

                 Type 2

               类型3

                Type 3

我不想将这些国家合并在一起(一些国家/地区有数千条记录,所有内容都围绕着数据所在的国家/地区来自)或类型(每个库存类型具有不同的字段,因此单个组合形式将具有一堆
空白字段)。

I don't want to combine the countries together (some countries have thousands of records and everything revolves around what country the data is from) or the types (each inventory type has different fields, so a single, combined form would have a bunch of blank fields).

有没有办法为Type 1创建一个表单,为Type 2创建一个表单,然后为Type 3创建一个表单,然后通过下拉菜单指向正确的country表包含每个国家名称的选择?如果是这样,有没有一种简单的方法可以为100多个
国家做到这一点!?

Is there any way to create a single form for Type 1, a form for Type 2, and a form for Type 3 that will then direct to the correct country table through a drop down menu selection containing each country name? If so, is there an easy way to do this for 100+ countries!?

希望这是有意义的。

任何和非常感谢所有帮助。

Any and all help is much appreciated.

谢谢。

推荐答案

如果没有更多信息,我建议将所有国家/地区保留在一个表中,只需使用外键在库存表中指向它们。另外,Type1,Type2和Type3是否分开?如果是这样,可能会有更好的方法。对于不同的
属性,可以尝试这样的事情:

Without more information, I would recommend keeping all the countries in one table and just use a foreign key to point to them in your inventory table. Also, are Type1, Type2, and Type3 separate tables? If so, there may be a better approach. For varying attributes, one might try something like this:

tblCountries

CountryID,pk

Country

tblCountries
CountryID, pk
Country

tblInvTypes

InvTypeID,pk

InvType

tblInvTypes
InvTypeID, pk
InvType

tblTypeAttributes

TypeAttribID ,pk

TypeID,fk

属性

tblTypeAttributes
TypeAttribID, pk
TypeID, fk
Attribute

tblInventory

InventoryID,pk

CountryID,fk

InvTypeID,fk

tblInventory
InventoryID, pk
CountryID, fk
InvTypeID, fk

tblInventoryDe​​tails

InvDetailID,pk

TypeAttribID, fk

说明

等...

tblInventoryDetails
InvDetailID, pk
TypeAttribID, fk
Description
etc...

希望有帮助......

Hope it helps...

这篇关于通过下拉菜单选择链接多个不相关的表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆