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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remote Views in Forms and Grids

Status
Not open for further replies.

itflash

Programmer
Joined
Jul 18, 2001
Messages
535
Location
GB
Hi

Sorry, this is a mundane question requiring a long answer, but I am just tearing my hair out.

I want a form to have a combo box, that selects clients. This is from a remote view.
Then I want a grid to show the contracts, which is a table in a foxpro database. This should be refreshed depeding on the client selected in the combo box.
All on one form.

How can I do this?

Maybe someone has an example app they could mail me?

Many Thanks in advance if someone can sort this one for me.
 
Well, let's work backwards. We should have some variable like "mClientID" which was set from the ComboBox. Now make your grid's record source type be 4 - SQL Statement. Then whereever you're selecting the client, you insert the line:

Code:
 thisform.gContracts.RecordSource = "SELECT* FROM tContracts Con INTO CURSOR cCursor WHERE Con.ClientID = mClientID"

This should get you started. If you need help setting up the ComboBox, let us know.
 
Thanks for the tip.

I need the grid to be updateable and I dont think SQL statements allows this.

I can get it working with two grids fine, but I would prefer a combo box and a grid.

One problem I face is that the remote view has no index, so I create one using INDEX.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top