Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Database and Reporting > One Flexgrid depending on another


Reply
 
Thread Tools Display Modes
  #1  
Old 02-25-2003, 06:00 PM
millennm
Guest
 
Posts: n/a
Default One Flexgrid depending on another


I have two flexgrids on one form. One is for customers(Customers Table) and the other is for orders(Orders Table) that these customers placed. When you click on the customer's flexgrid you should see the orders that were placed by that customer.

The customer's table and the orders table are linked through CUSTID.
CUSTID is the primary key in the customers table and a foreign key in the orders table.

Populating the customer flexgrid was easy. I just created a data environment (deReports.cmCustomers) that selected fields from the customer table for the customer flexgrid. I set the data source to deReports and data member to cmCustomers

My problem is populating the order flexgrid. I have the information for the order flexgrid but I can't get it to display anything each time I click the customer flexgrid. What I've done so far is:

created an sql statement in a data environment(deReports.cmCustOrder) that says:
"select * from orders where custid=?"


Private Sub flexCustomers_Click() ' the customer grid
I did the following:


Dim intCustID as Integer 'intCustID is parameter to be fed to sql

intCustID = flexCustomers.Text 'CustID click goes to parameter

If deReports.rscmCustOrder.State = adStateOpen then
deReports.rscmCustOrder.Close
End If 'close recordset before applying parameter to ? in sql

deReports.cmCustOrder intCustID 'send paramenter to ? in sql


Ok up to this point I know everything works. The data environment(deReports.cmCustOrder) for the orders flex grid gets fed the parameter into its ?. If I put a msg box:

MsgBox (deReports.rscmCustOrder(4))
in this code I'll see that the order data changes in the Msg box based on where I click on the Customer's flex grid.

But the orders flex grid doesn't show anything. I know the data is there though from the message box.

I've set the orders flex grid to .refresh after this click procedure.
I've set the data source to deReports and the data member to
cmCustOrder.
Still no data in the orders flexgrid.

How can I get the orders grid to set itself to the new recordset information that was created from the intCustID parameter?

Thank You,
Keith
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->