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

Grid not blank when user press New Invoice button

Status
Not open for further replies.

mstrcmtr

Programmer
Nov 14, 2007
103
PK
Setting Grid for Sale Invoice Detail Table

thisform.Grid1.LinkMaster = 'Header1'
thisform.Grid1.RecordSource = 'Detail1'
thisform.Grid1.RelationalExpr = 'Header1.KEY_PK'
thisform.Grid1.ChildOrder = 'Key_Fk'

---------------

SELECT Detail1

SET ORDER TO KEY_FK IN Detail1

---------------

SELECT Header1

SET ORDER TO KEY_PK
SET RELATION TO KEY_PK INTO Detail1
SET SKIP TO Detail1

------------------

Requirement:

Q. How can Blank the Grid (Child records) on Clicking New Invoice Command Button , currently it is showing all Child table records in Grid.

If both Parent child tables open in browse window when select the Header record it shows the relevant child records
 
Problem solved

Using thisform.Grid1.Refresh() instead of thisform.Refresh()
 
I'm pleased you've solved the problem, but I must say that your solution is surprising.

VFP Help topic for Refresh method said:
When a form is refreshed, all controls on the form are also refreshed.

So calling the Refresh for the form should also refresh the grid.

But if it works for you, that's fine.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top