# Re: Help !!!

Posted by AndyLin on February 04, 1999 at 13:55:50:

In Reply to: Re: Help !!! posted by Ta on February 04, 1999 at 10:42:26:

:
: : DBGrid is can not disign in run time
: : it support for design time only

: Following is my situation:

: DatabaseName: business.mdb contains tables such as
: customerName,Product and Transaction

: My form has a DBgridComboBox which displays all customer Name. when user click on different customer Name, information in textBoxes will be changed too!

: text1.text show customerID
: text2.text Show customerAddress
: ....
: ....
: I have already done this part. Don't worry about it!

: What I hope right now is when user click on
: Customer Name, DBGrid will show all the transactions made by this customer.

:
: SQL="select * from transaction_
: where CustomerID= '" & text1.text & "'"

: Data1.RecordSource=SQL
: Data1.Refresh

: If DBGrid.Datasource=data1 does not work,
: how can I assign the final result to DBGrid?

when you set dbgrid.datasource=data1 in design time

data1.recordsource="select * from customername"
data1.refresh
'the customername data in dbgrid
...
...
if you code again:
data1.recordsource="select * from transcation where ....."
data1.refresh
'the data in dbgrid will be changed by data1,the transcation data in dbgrid now,you don't need to code:DBGrid.Datasource=data1
sorry! My english is poor ,I hope you can understand.

Follow Ups:

- Re: Help !!! Ta 06:46:48 2/05/99 (1)
  - Re: Help !!! AndyLin 09:34:31 2/05/99 (0)