473,405 Members | 2,300 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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

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
2 987

"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Paul | last post by:
I want to use sessions to cover myself in case the user switches off cookies so I am passing the session ID manually through a hidden input field. This is what I have so far. index.php page...
1
by: Paul | last post by:
Hmmm, didn't seem to work. I have set session.use_cookies = 1 and session.use_trans_sid = 1 in my php.ini file. Index.php contains:...
3
by: Fredrik/Sweden | last post by:
Hi folks ! got this problem... i have a table 'Accounts' in my database, which contains a bunch of users. From the main menu i choose "edit user" and all users in the db are presented in a table....
4
by: bateman | last post by:
Hi, I have a rather puzzling problem, have asked the ASP experts at work with no joy and its driving me mad! I'll explain the steps in more detail below but the general problem is I am manually...
8
by: Alex Vinokur | last post by:
Various forms of argument passing ================================= C/C++ Performance Tests ======================= Using C/C++ Program Perfometer...
1
by: Maria | last post by:
Hello! I am new to Crystal reports an I have problems passing parameters form outside to Crystal report an creating a report with data from more than one table This is the problem: I have to...
6
by: RBCC | last post by:
Public Class fraction Dim m_numerator As Int16 Dim m_denominator As Int16 Public Event zerodenom() Public Property numerator() As Int16 Get Return m_numerator
7
by: Jason | last post by:
Hello I've got a very simple C# app, that has a datagrid, a text box, and a button which when clicked opens a second form... Form2 frm2 = new Form2(); frm2.Show(); When I place a datagrid,...
4
by: jej1216 | last post by:
I'm pretty new to PHP and MySQL. I have managed to create a form that inserts data to MySQL and to create a form to search the DB. Now here is my problem. I am unsuccessful coding a hidden...
6
by: gggram2000 | last post by:
I'd like to know how I go about passing two variables from one form to the next. For example, I can pass a variable like this: This demonstrates how to pass a variable to a form when the form is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.