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!

Update the grid from a different form

Status
Not open for further replies.

admdev

Programmer
May 17, 2006
56
0
0
US
Hi all,

Hope somebody can help me with this.

I am trying to update the grid on a form from another form. In other words, say form A has a grid. Form A calls form B, then form B updates the grid on form A.

Any help would be appreciated.

Thanks.
 
Thanks guys for your suggestions.

Imaginecorp- Before posting this questions I was already doing exactly what you suggested; in other words, passing form A as a parameter to form B. I was also passing the form A datasession ID as a parameter to form B. The problem I was facing and that is why I posted the question, was because I was having some issues switching between data sessions. However, I appreciate all the suggestions here. My forms use private data sessions.

I wanted to see if there were any other suggestions on handling this situation. I use to code in VB 6 and this was not an issue with VB.

I would think that by creating the cursor in the init event of form B, inserting the values to this cursor within form B, assigning the cursor to the THISFORM.parentform.grid1, and refreshing the grid should work, but it's not displaying the values. I am assuming this is happening because the cursor is lost after form B is closed.

Thanks.

 
Hello Admdev:
You already have the solution: Yes the cursor is lost, so create it in form A, Now it is accessable in Form B, make your changes and from Form B assign the cursor etc, before closing form B.
 
Oh; though not with Private Datasessions... Make Form B Default DataSession.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top