Need Help with VB Code Problem

Hi Rob,

Now I see what I did wrong. I was having trouble declaring the UD08Adapter because I wasn't adding the reference assembly for it. Now I can add the other code you referenced.

Many Thanks!

David Pfiester
Systems Accountant
NuStep Inc.
Phone: 734-769-3939 x150


--- In vantage@yahoogroups.com, "Rob Bucek" <rbucek@...> wrote:
>
> I was only able to briefly look at this but you may be missing your ud
> adapter method..
>
>
>
> It might look something like this..
>
>
>
> Dim adaptUD08 As UD08Adapter = New UD08Adapter(ReceiptEntryForm)
>
> adaptUD08.BOConnect()
>
> adaptUD08.GetaNewUD06()
>
>
>
> replace receiptentryform with the form name you are working in..
>
>
>
> also don't forget to add your references (tools/assembly reference
> manager)
>
> Rob Bucek
>
> Production Control Manager
>
> PH: (715) 284-5376 ext 311
>
> Mobile: (715)896-0590
>
> FAX: (715)284-4084
>
> <http://www.dsmfg.com/>
>
> (Click the logo to view our site) <http://www.dsmfg.com/>
>
>
>
>
>
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
> Of nustepvantage
> Sent: Wednesday, September 15, 2010 3:32 PM
> To: vantage@yahoogroups.com
> Subject: [Vantage] Need Help with VB Code Problem
>
>
>
>
>
> Hello All,
>
> I'm working on a VB procedure where the city, state, and zip fields in
> the customer table are automatically updated when the customer.zip field
> in is changed. The zip, city, and state data are coming from the UD08
> table. The code I have compiles OK, but when I try to run it I get an
> "Object reference not set to an instance of an object" error. I'm new at
> creating VB.Net code, so I'm not sure what I'm doing wrong. I think I'm
> having a problem connecting to UD08 data, but when I try to declare a
> variable to access the data there is a compile error saying UD08 is not
> defined. Here is the code that I have now:
>
> Private Sub Customer_AfterFieldChange(ByVal sender As object, ByVal args
> As DataColumnChangeEventArgs) Handles Customer_Column.ColumnChanged
>
> '// ** Argument Properties and Uses **
> '// args.Row("[FieldName]")
> '// args.Column, args.ProposedValue, args.Row
> 'Add Event Handler Code
>
>
> Select Case args.Column.ColumnName
>
> Case "Zip"
>
> Dim edvCustZip As EpiDataView = CType(oTrans.EpiDataViews("UD08"),
> EpiDataView)
>
> Dim txtZipCode as Int32 = edvCustZip.dataView(edvCustZip.Row)("Key1")
>
> Dim txtState as Int32 = edvCustZip.dataView(edvCustZip.Row)("Key2")
>
> Dim txtCity as Int32 = edvCustZip.dataView(edvCustZip.Row)("Key3")
>
> Dim edvCustomer As EpiDataView = CType(oTrans.EpiDataViews("Customer"),
> EpiDataView)
>
> edvCustomer.dataview(edvCustomer.Row)("Zip") = txtZipCode
> edvCustomer.Notify(New EpiNotifyArgs(oTrans, edvCustomer.Row,
> edvCustomer.Column))
>
> edvCustomer.dataview(edvCustomer.Row)("State") = txtState
> edvCustomer.Notify(New EpiNotifyArgs(oTrans, edvCustomer.Row,
> edvCustomer.Column))
>
> edvCustomer.dataview(edvCustomer.Row)("City") = txtCity
> edvCustomer.Notify(New EpiNotifyArgs(oTrans, edvCustomer.Row,
> edvCustomer.Column))
>
> Case Else
>
> End Select
>
> End Sub
>
> If anyone could point me in the right direction I would really
> appreciate it. We are currently running Vantage 406A.
>
> Thanks,
>
> David Pfiester
> Systems Accountant
> NuStep Inc.
> Phone: 734-769-3939 x150
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
Hello All,

I'm working on a VB procedure where the city, state, and zip fields in the customer table are automatically updated when the customer.zip field in is changed. The zip, city, and state data are coming from the UD08 table. The code I have compiles OK, but when I try to run it I get an "Object reference not set to an instance of an object" error. I'm new at creating VB.Net code, so I'm not sure what I'm doing wrong. I think I'm having a problem connecting to UD08 data, but when I try to declare a variable to access the data there is a compile error saying UD08 is not defined. Here is the code that I have now:

Private Sub Customer_AfterFieldChange(ByVal sender As object, ByVal args As DataColumnChangeEventArgs) Handles Customer_Column.ColumnChanged

'// ** Argument Properties and Uses **
'// args.Row("[FieldName]")
'// args.Column, args.ProposedValue, args.Row
'Add Event Handler Code


Select Case args.Column.ColumnName

Case "Zip"

Dim edvCustZip As EpiDataView = CType(oTrans.EpiDataViews("UD08"), EpiDataView)

Dim txtZipCode as Int32 = edvCustZip.dataView(edvCustZip.Row)("Key1")

Dim txtState as Int32 = edvCustZip.dataView(edvCustZip.Row)("Key2")

Dim txtCity as Int32 = edvCustZip.dataView(edvCustZip.Row)("Key3")

Dim edvCustomer As EpiDataView = CType(oTrans.EpiDataViews("Customer"), EpiDataView)

edvCustomer.dataview(edvCustomer.Row)("Zip") = txtZipCode
edvCustomer.Notify(New EpiNotifyArgs(oTrans, edvCustomer.Row, edvCustomer.Column))

edvCustomer.dataview(edvCustomer.Row)("State") = txtState
edvCustomer.Notify(New EpiNotifyArgs(oTrans, edvCustomer.Row, edvCustomer.Column))

edvCustomer.dataview(edvCustomer.Row)("City") = txtCity
edvCustomer.Notify(New EpiNotifyArgs(oTrans, edvCustomer.Row, edvCustomer.Column))

Case Else

End Select

End Sub

If anyone could point me in the right direction I would really appreciate it. We are currently running Vantage 406A.

Thanks,

David Pfiester
Systems Accountant
NuStep Inc.
Phone: 734-769-3939 x150
I was only able to briefly look at this but you may be missing your ud
adapter method..



It might look something like this..



Dim adaptUD08 As UD08Adapter = New UD08Adapter(ReceiptEntryForm)

adaptUD08.BOConnect()

adaptUD08.GetaNewUD06()



replace receiptentryform with the form name you are working in..



also don't forget to add your references (tools/assembly reference
manager)

Rob Bucek

Production Control Manager

PH: (715) 284-5376 ext 311

Mobile: (715)896-0590

FAX: (715)284-4084

<http://www.dsmfg.com/>

(Click the logo to view our site) <http://www.dsmfg.com/>





From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of nustepvantage
Sent: Wednesday, September 15, 2010 3:32 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Need Help with VB Code Problem





Hello All,

I'm working on a VB procedure where the city, state, and zip fields in
the customer table are automatically updated when the customer.zip field
in is changed. The zip, city, and state data are coming from the UD08
table. The code I have compiles OK, but when I try to run it I get an
"Object reference not set to an instance of an object" error. I'm new at
creating VB.Net code, so I'm not sure what I'm doing wrong. I think I'm
having a problem connecting to UD08 data, but when I try to declare a
variable to access the data there is a compile error saying UD08 is not
defined. Here is the code that I have now:

Private Sub Customer_AfterFieldChange(ByVal sender As object, ByVal args
As DataColumnChangeEventArgs) Handles Customer_Column.ColumnChanged

'// ** Argument Properties and Uses **
'// args.Row("[FieldName]")
'// args.Column, args.ProposedValue, args.Row
'Add Event Handler Code


Select Case args.Column.ColumnName

Case "Zip"

Dim edvCustZip As EpiDataView = CType(oTrans.EpiDataViews("UD08"),
EpiDataView)

Dim txtZipCode as Int32 = edvCustZip.dataView(edvCustZip.Row)("Key1")

Dim txtState as Int32 = edvCustZip.dataView(edvCustZip.Row)("Key2")

Dim txtCity as Int32 = edvCustZip.dataView(edvCustZip.Row)("Key3")

Dim edvCustomer As EpiDataView = CType(oTrans.EpiDataViews("Customer"),
EpiDataView)

edvCustomer.dataview(edvCustomer.Row)("Zip") = txtZipCode
edvCustomer.Notify(New EpiNotifyArgs(oTrans, edvCustomer.Row,
edvCustomer.Column))

edvCustomer.dataview(edvCustomer.Row)("State") = txtState
edvCustomer.Notify(New EpiNotifyArgs(oTrans, edvCustomer.Row,
edvCustomer.Column))

edvCustomer.dataview(edvCustomer.Row)("City") = txtCity
edvCustomer.Notify(New EpiNotifyArgs(oTrans, edvCustomer.Row,
edvCustomer.Column))

Case Else

End Select

End Sub

If anyone could point me in the right direction I would really
appreciate it. We are currently running Vantage 406A.

Thanks,

David Pfiester
Systems Accountant
NuStep Inc.
Phone: 734-769-3939 x150





[Non-text portions of this message have been removed]