Need Help with VB Code Problem with EpiCombo

Hi Sean,

Thanks for your input.

How would you use the split() functionality? I'm kind of green at this. I will try your messaagebox.show idea.

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



--- In vantage@yahoogroups.com, "Sean McDaniel" <smcdaniel@...> wrote:
>
> Just a thought -- if you have the combo being populated with key1, key2 and key3 why are you then going through the adapter to get the same information? You should be able to get the selected value and parse that out to retrieve the city/state/zip. I think that you can use the split() functionality within vb.net to accomplish this very easily.
>
> As for the "hanging" I'd throw in some messagebox.show("") statements to figure out what is going wrong.
>
> ________________________________
>
> From: vantage@yahoogroups.com on behalf of nustepvantage
> Sent: Tue 9/21/2010 8:33 AM
> To: vantage@yahoogroups.com
> Subject: [Vantage] Need Help with VB Code Problem with EpiCombo
>
>
>
>
> Hello All,
>
> I seem to be stuck with some VB code and need some help in the right direction. I'm new at this and learning as I go.
>
> I have an EpiCombo box on the Customer form that is tied to the Zip field. The EpiCombo pulls in the Key1, Key2, and Key3 fields from the UD08 table. The data in these fields is zip, state, and city respectively. My goal is that when a user selects a zip from the EpiCombo box the Customer state and city fields will auto populate based on their selection from the UD08 table. I'm using the AfterFieldChange event. When my code fires I can change the zip in the control, but I cannot tab off the control. Below is the code I have so far. We are on Vantage 406A.
>
> Thanks in advance for the help!
>
> David Pfiester
> Systems Accountant
> NuStep Inc.
> Phone: 734-769-3939 x150
>
> 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 edv As EpiDataView
> edv = CType(oTrans.EpiDataViews("Customer"), EpiDataView)
> Dim uD08Adapter as UD08Adapter
> Dim currentZipCode As String = String.Empty
> uD08Adapter = new UD08Adapter(CustomerEntryForm)
> uD08Adapter.BOConnect()
>
> currentZipCode = edv.dataView(edv.Row)("Zip").ToString()
>
> Dim edvUD08 as Boolean = uD08Adapter.GetById("key1", "key2", "key3", "key4", "key5")
>
> If edvUd08 = True then
>
> edv.dataView(0)("State") = uD08Adapter.UD08Data.UD08.Rows(0)("Key2")
> edv.Notify(New EpiNotifyArgs(CustomerEntryForm,edv.Row,edv.Column))
>
> edv.dataView(0)("City") = uD08Adapter.UD08Data.UD08.Rows(0)("Key3")
> edv.Notify(New EpiNotifyArgs(CustomerEntryForm,edv.Row,edv.Column))
>
> End If
>
> uD08Adapter.Dispose()
>
> Case Else
>
> End Select
>
> End Sub
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
Hello All,

I seem to be stuck with some VB code and need some help in the right direction. I'm new at this and learning as I go.

I have an EpiCombo box on the Customer form that is tied to the Zip field. The EpiCombo pulls in the Key1, Key2, and Key3 fields from the UD08 table. The data in these fields is zip, state, and city respectively. My goal is that when a user selects a zip from the EpiCombo box the Customer state and city fields will auto populate based on their selection from the UD08 table. I'm using the AfterFieldChange event. When my code fires I can change the zip in the control, but I cannot tab off the control. Below is the code I have so far. We are on Vantage 406A.

Thanks in advance for the help!

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


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 edv As EpiDataView
edv = CType(oTrans.EpiDataViews("Customer"), EpiDataView)
Dim uD08Adapter as UD08Adapter
Dim currentZipCode As String = String.Empty
uD08Adapter = new UD08Adapter(CustomerEntryForm)
uD08Adapter.BOConnect()

currentZipCode = edv.dataView(edv.Row)("Zip").ToString()

Dim edvUD08 as Boolean = uD08Adapter.GetById("key1", "key2", "key3", "key4", "key5")

If edvUd08 = True then

edv.dataView(0)("State") = uD08Adapter.UD08Data.UD08.Rows(0)("Key2")
edv.Notify(New EpiNotifyArgs(CustomerEntryForm,edv.Row,edv.Column))

edv.dataView(0)("City") = uD08Adapter.UD08Data.UD08.Rows(0)("Key3")
edv.Notify(New EpiNotifyArgs(CustomerEntryForm,edv.Row,edv.Column))



End If

uD08Adapter.Dispose()

Case Else

End Select

End Sub
Just a thought -- if you have the combo being populated with key1, key2 and key3 why are you then going through the adapter to get the same information? You should be able to get the selected value and parse that out to retrieve the city/state/zip. I think that you can use the split() functionality within vb.net to accomplish this very easily.

As for the "hanging" I'd throw in some messagebox.show("") statements to figure out what is going wrong.

________________________________

From: vantage@yahoogroups.com on behalf of nustepvantage
Sent: Tue 9/21/2010 8:33 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Need Help with VB Code Problem with EpiCombo




Hello All,

I seem to be stuck with some VB code and need some help in the right direction. I'm new at this and learning as I go.

I have an EpiCombo box on the Customer form that is tied to the Zip field. The EpiCombo pulls in the Key1, Key2, and Key3 fields from the UD08 table. The data in these fields is zip, state, and city respectively. My goal is that when a user selects a zip from the EpiCombo box the Customer state and city fields will auto populate based on their selection from the UD08 table. I'm using the AfterFieldChange event. When my code fires I can change the zip in the control, but I cannot tab off the control. Below is the code I have so far. We are on Vantage 406A.

Thanks in advance for the help!

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

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 edv As EpiDataView
edv = CType(oTrans.EpiDataViews("Customer"), EpiDataView)
Dim uD08Adapter as UD08Adapter
Dim currentZipCode As String = String.Empty
uD08Adapter = new UD08Adapter(CustomerEntryForm)
uD08Adapter.BOConnect()

currentZipCode = edv.dataView(edv.Row)("Zip").ToString()

Dim edvUD08 as Boolean = uD08Adapter.GetById("key1", "key2", "key3", "key4", "key5")

If edvUd08 = True then

edv.dataView(0)("State") = uD08Adapter.UD08Data.UD08.Rows(0)("Key2")
edv.Notify(New EpiNotifyArgs(CustomerEntryForm,edv.Row,edv.Column))

edv.dataView(0)("City") = uD08Adapter.UD08Data.UD08.Rows(0)("Key3")
edv.Notify(New EpiNotifyArgs(CustomerEntryForm,edv.Row,edv.Column))

End If

uD08Adapter.Dispose()

Case Else

End Select

End Sub






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