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

Refreshing grid after new record added

Status
Not open for further replies.

sermac

Programmer
Jul 27, 2002
238
US
Hi vfp7 professionals:
I have a from with 2 grids on it, grid 1 and grid 2
In the data enviroment I have grid1 being the parent
bal_id is primary, and to grid2 index balcat1_id is regular and linked to bal_id reg/child "many".

My button "New"

SELECT balsheetcat1
SET DELETED off
SET FILTER TO
SET ORDER TO balcat1_id
GO bott
newcont=balcat1_id+1
APPEND BLANK
Replace balcat1_id WITH newcont
SET DELETED on
&&If I browse here the record was added and is just fine.
thisform.grid2.Recordsource=' '
SELECT balsheetcat1
Thisform.grid2.RecordSource=('balsheetcat1')
Thisform.grid2.refresh

but I can't the grid to refresh unless I go out of the form and come back in.

Any suggestions would be appreciated, THX Bill
 
Try to add grid2.column1.text1.setfocus before "Thisform.grid2.refresh"
 
sermac

thisform.grid2.Recordsource='' && There shouldn't be any space between the quotes.
SELECT balsheetcat1
Thisform.grid2.RecordSource='balsheetcat1'&& No need for brackets
Thisform.grid2.refresh

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top