Urgent help required
I'm trying to do the following but it is not working properly:
In my project I have several forms. In some forms I have a lookup button.
What I'm trying to do is- when the lookup button is clicked, another form
with a datagrid is openned and some records are displayed on the grid
(from SQL Server). Up to this point there is no problem. The next what I
want is- when a record on the grid is clicked, the relevant record will be
displayed in a text box in the from. This only works inone form. It does
not work in any other form. Here is the code I'm using-
Private Sub dtGrid_Click(sender As Object, e As EventArgs) Handles
dtGrid.Click Dim i As Integer
i = dtGrid.CurrentRow.Index
Try
frmServicing.txtRego.Text = dtGrid.Item(0, i).Value
frmVehicle.txtcCode.Text = dtGrid.Item(0, i).Value
frmVehicle.txtAllocation.Text = dtGrid.Item(1, i).Value
Catch ex As Exception
End Try
It only works for frmVehicle. I tried all possible ways but no luck. Any
idea?
End Sub
No comments:
Post a Comment