如何知道一个字段的值,在表上提取其他字段值 [英] How can I extract other field values on a table knowing the value of one field

查看:54
本文介绍了如何知道一个字段的值,在表上提取其他字段值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两张桌子:


第一张桌子叫:

产品

它有以下字段

ProdName

产品

产品类型

产品说明


第二个表是叫:

ProductInput

包含以下字段

ProductId

数量

价格

TaxPercentage

...和其他人......


我根据表''ProductInput'制作了一个表格

我使用组合来通过

ProdName(Products表)获取ProdId(Products表)并将其放在ProductId(ProductInput表)中


我的问题是:

如何使用

ProductId(ProductInput表)获取表''Products''中的相应记录,提取其他字段(如ProdType

和ProdTaxes -Product表 - )并将它们放在ProductInput表中的TaxPercentage,

Price等字段中。

I have two tables:

The first table is called:
Products
it has the following fields
ProdName
ProdId
ProdType
ProdTaxes

The second table is called:
ProductInput
with the following fields
ProductId
Quantity
Price
TaxPercentage
...and others...

I have made a form based on table ''ProductInput''
I use a combo to get the ProdId (Products table) by means of
ProdName (Products table) and I put it in ProductId (ProductInput table)

My question is:
How can I get the corresponding record in the table ''Products'' using
ProductId (ProductInput table), to extract the other fields (like ProdType
and ProdTaxes -Product table-) and put them in the fields TaxPercentage,
Price, etc of ProductInput table.

推荐答案

尝试使用此SQL(或从中派生的东西)作为表单的基础,而不是指向表格的简单链接:
Try using this SQL (or something derived therefrom) as the basis for your form rather than a simple link to the table :
展开 | 选择 | Wrap | 行号


对不起,我很新,这个

,我不明白这个想法

我应该把这段代码放在哪里?

我能否详细解释它的作用?


非常感谢!
I am sorry but I am very new at this
and I do not understand the idea
Where should I put this code?
And could I get a thorough explanation of what it does?

Thanks a lot!

在设计视图中编辑表单。

查看表单的属性/>
在顶部附近有一个Record Source属性。

选择此项并输入上一篇文章中的SQL或修改后的版本。

按F1获取帮助在记录来源属性。


这应该让你去。
Edit the form in Design View.
Look at properties of the form.
Near the top there is a Record Source property.
Select this and enter the SQL from previous post or your modified version.
Press F1 for help on the Record Source property.

This should get you going.


这篇关于如何知道一个字段的值,在表上提取其他字段值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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