By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,607 Members | 1,944 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,607 IT Pros & Developers. It's quick & easy.

Passing a value in to a form- revisited..another secnario

P: n/a
Hi all. This time I just want to pass a interger into my form. It seemed
like a simple thing to do based on the last time when Seth helped me with a
complex one. Well not for me it seems..

My calling code:

Dim frmAFT As New frmBATFMaint(ByVal InvHID As InvHeaderID)

frmAFT.MdiParent = Me.MdiParent

frmAFT.Show()

My Form code:

Imports System.Diagnostics.Debug

Public Class frmBATFMaint

Public locInvHeaderID As Integer

Public Sub New(ByVal InvHID As locInvHeaderID)

InitializeComponent()

Try

Me.BatF_BO1.FillByInventoryItemID(GRS2.frmInventor yMaint.gloInvHeaderID)

'--record exists.. put in edit mode...

Me.Edit()

Catch ex As Exception

'-- no record exists.. so put in add mode...

Me.Add()

Me.BatF_BO1.Item_ID = frmInventoryMaint.gloInvHeaderID

System.Diagnostics.Debug.WriteLine("gloInvHeader: " &
GRS2.frmInventoryMaint.gloInvHeaderID)

End Try

End Sub

Obviously the passed in value is not getting there.. as the debug window is
showing 0 when the passed in value is a 4. So what am I doing wrong?

Regards,

Robert


Jul 23 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a

"Robert Johnson" <jo*******@sbcglobal.netwrote in message
news:OR**************@TK2MSFTNGP06.phx.gbl...
Hi all. This time I just want to pass a interger into my form. It seemed
like a simple thing to do based on the last time when Seth helped me with
a complex one. Well not for me it seems..

My calling code:

Dim frmAFT As New frmBATFMaint(ByVal InvHID As InvHeaderID)

frmAFT.MdiParent = Me.MdiParent

frmAFT.Show()

My Form code:

Imports System.Diagnostics.Debug

Public Class frmBATFMaint

Public locInvHeaderID As Integer

Public Sub New(ByVal InvHID As locInvHeaderID)

InitializeComponent()

Try
Me.BatF_BO1.FillByInventoryItemID(GRS2.frmInventor yMaint.gloInvHeaderID)

'--record exists.. put in edit mode...

Me.Edit()

Catch ex As Exception

'-- no record exists.. so put in add mode...

Me.Add()

Me.BatF_BO1.Item_ID = frmInventoryMaint.gloInvHeaderID

System.Diagnostics.Debug.WriteLine("gloInvHeader: " &
GRS2.frmInventoryMaint.gloInvHeaderID)

End Try

End Sub

Obviously the passed in value is not getting there.. as the debug window
is showing 0 when the passed in value is a 4. So what am I doing wrong?

Regards,

Robert

Sorry the only thing obvious is that you are not using the value passed into
your constructor.

LS

Jul 23 '07 #2

P: n/a
Just figured out that I'm not using a Get and Set constructor..

Robert

"Lloyd Sheen" <a@b.cwrote in message
news:uT**************@TK2MSFTNGP02.phx.gbl...
>
"Robert Johnson" <jo*******@sbcglobal.netwrote in message
news:OR**************@TK2MSFTNGP06.phx.gbl...
>Hi all. This time I just want to pass a interger into my form. It seemed
like a simple thing to do based on the last time when Seth helped me with
a complex one. Well not for me it seems..

My calling code:

Dim frmAFT As New frmBATFMaint(ByVal InvHID As InvHeaderID)

frmAFT.MdiParent = Me.MdiParent

frmAFT.Show()

My Form code:

Imports System.Diagnostics.Debug

Public Class frmBATFMaint

Public locInvHeaderID As Integer

Public Sub New(ByVal InvHID As locInvHeaderID)

InitializeComponent()

Try
Me.BatF_BO1.FillByInventoryItemID(GRS2.frmInvento ryMaint.gloInvHeaderID)

'--record exists.. put in edit mode...

Me.Edit()

Catch ex As Exception

'-- no record exists.. so put in add mode...

Me.Add()

Me.BatF_BO1.Item_ID = frmInventoryMaint.gloInvHeaderID

System.Diagnostics.Debug.WriteLine("gloInvHeader: " &
GRS2.frmInventoryMaint.gloInvHeaderID)

End Try

End Sub

Obviously the passed in value is not getting there.. as the debug window
is showing 0 when the passed in value is a 4. So what am I doing wrong?

Regards,

Robert


Sorry the only thing obvious is that you are not using the value passed
into your constructor.

LS

Jul 23 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.