Solved

Form Updates

Posted on 2006-07-21
6
186 Views
Last Modified: 2010-04-23
I have a form that has a dat grid on it with a lot of information. When you select any row a second form comes up and allows you to make changes to the form. Once they hit updat I would like the data grid on the first form to be updated with the new data. I have the data grid code in a function call and it works fine. Please help.

Thanks
0
Comment
Question by:mwhodges
  • 3
  • 3
6 Comments
 
LVL 17

Expert Comment

by:ZeonFlash
ID: 17155163
When you are opening the "Update" form, how are you passing the row information to the form?  Are you sending the values of the each of the row cells, or are you passing the dataset/datatable/datarow?
0
 

Author Comment

by:mwhodges
ID: 17155181
I am passing the identyfing information and performing another qury he second form because there is more data then on the data grid that I am trying to display here. The first form while large is a summary of sorts.
0
 
LVL 17

Expert Comment

by:ZeonFlash
ID: 17155504
A few more questions:
-Does the update form need to stay open, and by this, does the user need to be able to change something, hit Update, change something, hit Update again, etc?
-Are you looking to refresh the entire grid, or just the row that was updated?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:mwhodges
ID: 17155537
The entire grid would be ok. The 1st form is staying open I am showing the 2nd form in a show dialog.  THey will choose a row in the data grid the 2nd form is shown with all the information in it. They would make their changes hit update and the 2nd form would close and the data grid would be updated.
0
 
LVL 17

Accepted Solution

by:
ZeonFlash earned 400 total points
ID: 17156120
Sounds easy enough :).  Which part are you missing?  

-------------Datagrid Form---------------
    Private Sub DataGrid1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGrid1.Click
        dim frmUpdateForm as New UpdateForm(value, value, ...)
        frmUpdateForm.ShowDialog()

        'Upon reaching here, the Update form has been "closed", so refresh the grid
        RefreshDataGrid()
    End Sub

    Private Sub RefreshDataGrid()
      'Code to populate the Datagrid
    End Sub
-------------------------------------------

-------------Update Form---------------
    Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click
        'Database update code here

        Me.Hide()
    End Sub
-------------------------------------------
0
 

Author Comment

by:mwhodges
ID: 17156735
Sweet... I didnt know that the showdialog box freezes the code until it regains focus. Thanks a bunch.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now