Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datagrid 6.0 control Question

Status
Not open for further replies.

JasSim

Programmer
Jul 24, 2000
12
0
0
US
I have a form that has an order number on it and I have a datagrid that needs to get that order number and show the notes that correspond to the main form's order number. They are on the same form, and would work together like a subform in Access would. The datagrid uses a dataenvironment, more specifically a stored procedure to populate it. The stored procedure needs to be sent a variable (the order number). Where and how would I place the grid or the code so that on the change event of the order field the datagrid would shoe the new notes that correspond to that order? Thanks in advance!!
 
Have you tried dataenvironment.refresh

This should probably go in the afterupdate code of the order number field. Have the variable of the stored procedure = the .text of the order number field, run the stored procedure then do a dataenvironment.refresh, you may also have to refresh the grid.

Hope this helps

Adam
 
hi, the easy way out

if ur order no. is a combo box then set the DBGrid to a DataControl and set Datacontorl's Record source like this

Private Sub Cmb_Click()

If cmb.text <> &quot;&quot; then
Data1.Recordsource = &quot;select * from table where order = '&quot; & cmb.text & &quot;'&quot;
Data1.Refresh
DBGrid.Refresh
End If

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top