freelanceprogrammers.org Forum Index » ASP
passing values from a form to dialog form.
Joined: 08 Sep 2005
Posts: 2
passing values from a form to dialog form.
I have declared the following variables in the form transoverride.vb
Dim Account_Name, PolicyNumber, TransCodeOrig, TransEffDate,
Override_Action, Override_New_Renewal, Override_Transaction_Code,
ModifiedDate, ModifiedUID, Plan_Year As String
Dim RowNum As Integer
The goal of this question is that I want to pass the above variables
to a dialog form called edittransoverride.
Public Sub DoModify()
Dim dTable As DataTable = Me.DataGrid1.DataSource
Dim bm As BindingManagerBase = Me.DataGrid1.BindingContext
(Me.DataGrid1.DataSource, Me.DataGrid1.DataMember)
Dim dRow As DataRow = CType(bm.Current, DataRowView).Row
Me.lbNumRec.Text = Me.DsTransOverride1.Tables
(0).Rows.Count.ToString()
Dim cEditTransOverride As New EditTransOverride
cEditTransOverride.ShowDialog()
cEditTransOverride.Dispose()
Me.SqlDataAdapter1.Update(Me.DsTransOverride1)
Me.DsTransOverride1.Tables(0).Clear()
Me.SqlDataAdapter1.Fill(Me.DsTransOverride1)
Me.DataGrid1.Refresh()
End Sub
In the subroutine that belogs to transoverride.vb I assign them
values before passing to the dialog form.
Private Sub highLightRow(ByVal sender As Object, ByVal e As
MouseEventArgs)
Dim pt = New Point(e.X, e.Y)
Dim grd As DataGrid = CType(sender, DataGrid)
Dim hit As DataGrid.HitTestInfo = grd.HitTest(pt)
If hit.Type = grd.HitTestType.Cell Then
grd.CurrentCell = New DataGridCell(hit.Row, hit.Column)
RowNum = hit.Row
grd.Select(RowNum)
Account_Name = Convert.ToString(grd.Item(RowNum, 0))
PolicyNumber = Convert.ToString(grd.Item(RowNum, 1))
TransCodeOrig = Convert.ToString(grd.Item(RowNum, 2))
TransEffDate = Convert.ToString(grd.Item(RowNum, 3))
Override_Action = Convert.ToString(grd.Item(RowNum, 4))
Override_New_Renewal = Convert.ToString(grd.Item(RowNum,
5))
Override_Transaction_Code = Convert.ToString(grd.Item
(RowNum, 6))
ModifiedUID = Convert.ToString(grd.Item(RowNum, 7))
ModifiedDate = Convert.ToString(grd.Item(RowNum, 8))
Plan_Year = Convert.ToString(grd.Item(RowNum, 9))
End If
End Sub
Now I must get these values in the load of the edittransoverride.vb
dialog form.
Private Sub EditForm_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
` Save old values
oldPolicyNumber = PolicyNumber
oldTransCode = TransCodeOrig
oldTransEffDate = TransEffDate
` Verify for Null fields
FillTextBox(txtAccountName, Account_Name)
FillTextBox(txtPolicyNumber, PolicyNumber)
FillTextBox(txtUserId, ModifiedUID)
dteEffDt.Text = TransEffDate.ToShortDateString()
dteEffDt.Value = TransEffDate.ToShortDateString()
FillTextBox(txtDate, ModifiedDate)
FillComboBox(cmbOriginalTransCode, TransCodeOrig)
FillComboBox(cmbOverrideAction, Override_Action)
FillComboBox(cmbOverrideNR, Override_New_Renewal)
FillComboBox(cmbOverrideTransactionCode,
Override_Transaction_Code)
txtPlanYear.Text = Plan_Year
Me.lbRecNum.Text = RowNum
End Sub
How do I go about defining these variables so I can use them in my
Load routine of the Dialog form.?
All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
Booking Calendar - reservation calendar script
Land Surveying - total station instruments and equipments
China Wholesale - Electronics Products
Character Studio - Tutorials and Help
Booking Calendar - reservation calendar script
Land Surveying - total station instruments and equipments
China Wholesale - Electronics Products
Character Studio - Tutorials and Help







