K
Kris Rockwell
Hello,
I have created Sub that requires one argument which is a string. However,
when I run the Sub, the string is not passed as it should be. Here is the
code
Public Sub fCrewLookup(ByVal x As String)
CrewPos = x
Me.AddCrew.Visible = False
Me.CrewLookup.Visible = True
SqlDataAdapter3.Fill(DataSet41)
dgCrewLookup.SelectedIndex() = -1
dgCrewLookup.DataBind()
End Sub
Private Sub ibPFLookup_Click(ByVal sender As System.Object, ByVal e As
System.Web.UI.ImageClickEventArgs) Handles ibPFLookup.Click
fCrewLookup("PF")
End Sub
And finally what is supposed to be the result:
Private Sub CrewLookupSelect_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles CrewLookupSelect.Click
If dgCrewLookup.SelectedIndex < 0 Then
MessageBox.Show("Please select a crew member.", "Selection Error",
MessageBoxButtons.OK, MessageBoxIcon.Information,
MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly)
Else
Dim sUID As String
sUID = dgCrewLookup.SelectedItem.Cells(0).Text()
PFID.Text = CrewPos
Me.CrewLookup.Visible = False
Me.AddCrew.Visible = True
End If
End Sub
End Class
The variable CrewPos is declared as a variable in the Public Class block so
that it is global in scope to the entire application.What am I missing that
is not causing the argument to be passed? This works fin in VB.NET, but not
using VB in ASP.NET.
Thanks in advance,
Kris
I have created Sub that requires one argument which is a string. However,
when I run the Sub, the string is not passed as it should be. Here is the
code
Public Sub fCrewLookup(ByVal x As String)
CrewPos = x
Me.AddCrew.Visible = False
Me.CrewLookup.Visible = True
SqlDataAdapter3.Fill(DataSet41)
dgCrewLookup.SelectedIndex() = -1
dgCrewLookup.DataBind()
End Sub
Private Sub ibPFLookup_Click(ByVal sender As System.Object, ByVal e As
System.Web.UI.ImageClickEventArgs) Handles ibPFLookup.Click
fCrewLookup("PF")
End Sub
And finally what is supposed to be the result:
Private Sub CrewLookupSelect_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles CrewLookupSelect.Click
If dgCrewLookup.SelectedIndex < 0 Then
MessageBox.Show("Please select a crew member.", "Selection Error",
MessageBoxButtons.OK, MessageBoxIcon.Information,
MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly)
Else
Dim sUID As String
sUID = dgCrewLookup.SelectedItem.Cells(0).Text()
PFID.Text = CrewPos
Me.CrewLookup.Visible = False
Me.AddCrew.Visible = True
End If
End Sub
End Class
The variable CrewPos is declared as a variable in the Public Class block so
that it is global in scope to the entire application.What am I missing that
is not causing the argument to be passed? This works fin in VB.NET, but not
using VB in ASP.NET.
Thanks in advance,
Kris