# Re: DBcombol的问题

Posted by XF on August 25, 1998 at 17:16:08:

In Reply to: DBcombol的问题 posted by yeong huann on August 25, 1998 at 16:45:01:

: 我在表单上安排了一个DBcombol物件,它连结至DATA2这个物件
: 当我按下DBcombo1物件时执行下面这一段SQL指令
: Form2.Data2.RecordSource = "SELECT DISTINCT ( " & comtext & " ) FROM 产品清单"
: ps: comtext 是指使用者选择的栏位名称
: 但实际上我希望DATA2每次筛选的资料是源至DATA1筛选之后的结果
: ps:DATA1会在DATA2筛选之前先行筛选,且DATA1与DATA2各另有它
: 用,不可互相影响.
: 请问各位先进,我上述的SQL指令中的 "FROM 产品清单" 要如何修改才会
: 达到我的需求,或另有其它方法.......谢谢

I thank there are two method to solve your problem

first is use sub SQL query, like this
"SELECT * FROM Pub WHERE TARGET IN (SELECT TARGET FROM Books WHERE Master = 'Red')"
it is mean that data2.RecordSource is a branch from Data1.RrcordSource .

secondly , I don't understand that many person tend to use data control, in my experience,
I recommand you to use DAO Object directly, and make program all by hand, so you will find
there are a lot of method can be use than data control. Data control is not for professional
program development, it is just for samll scale problem or simple problem, if you use it for
a large scale problem, you could be meet many problems that you must be recovered.
if you use DAO to make your program, it is not a problem that you asked.

If you've kown those already, I will be sorry.
Good luck!

Follow Ups:

- 谢谢XF赐教 yeong huann 19:26:16 8/25/98 (0)