dr223
August 11th, 2009, 07:51 AM
Hallo,
I have a form called FrmPracDetails which is built up with a List view called LvwColProc.
Therefore when you click a field on the LvwColProc it takes you to another form called FrmColProcessing, here you can make changes to certain fields which are also present on FrmPracDetails.
What I want to do is when you make changes on FrmColProcesing and Click the Save Button (which calls the Save function)the changes appear instantly on FrmPracDetails.
Please note, FrmColProcessing will always be open next to FrmPracDetails.
I have tried to put this code in the Save function present in FrmColProcessing as shown below, but it doesnt Refresh FrmPracDetails form.
Any ideas please, thanks
Private Sub Save()
Dim conn As SqlConnection = GetDbConnection()
Dim query As String
Dim cmd As New SqlCommand
Try
query = "UPDATE gprdsql.TblCollections SET Additional_info ='" & _
TxtAddInfo.Text & "' where col_uid='" & _
TextBox3.Text & "'"
cmd = New SqlCommand(query, conn)
cmd.ExecuteNonQuery()
query = "UPDATE gprdsql.TblCollections SET stage ='" & _
CboColStage.Text & "' where col_uid='" & _
TextBox3.Text & "'"
cmd = New SqlCommand(query, conn)
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Information, "GCPM")
End Try
MsgBox("Details have been updated", MsgBoxStyle.Information, "GCPM")
FrmPracDetails.LvwColProc.Refresh()
End Sub
I have a form called FrmPracDetails which is built up with a List view called LvwColProc.
Therefore when you click a field on the LvwColProc it takes you to another form called FrmColProcessing, here you can make changes to certain fields which are also present on FrmPracDetails.
What I want to do is when you make changes on FrmColProcesing and Click the Save Button (which calls the Save function)the changes appear instantly on FrmPracDetails.
Please note, FrmColProcessing will always be open next to FrmPracDetails.
I have tried to put this code in the Save function present in FrmColProcessing as shown below, but it doesnt Refresh FrmPracDetails form.
Any ideas please, thanks
Private Sub Save()
Dim conn As SqlConnection = GetDbConnection()
Dim query As String
Dim cmd As New SqlCommand
Try
query = "UPDATE gprdsql.TblCollections SET Additional_info ='" & _
TxtAddInfo.Text & "' where col_uid='" & _
TextBox3.Text & "'"
cmd = New SqlCommand(query, conn)
cmd.ExecuteNonQuery()
query = "UPDATE gprdsql.TblCollections SET stage ='" & _
CboColStage.Text & "' where col_uid='" & _
TextBox3.Text & "'"
cmd = New SqlCommand(query, conn)
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Information, "GCPM")
End Try
MsgBox("Details have been updated", MsgBoxStyle.Information, "GCPM")
FrmPracDetails.LvwColProc.Refresh()
End Sub