You want to enclose your code within an initial If test loop that gracefully exits when
edvPR.Row <0.
That can sometimes cause some funky behavior in these event driven apps where it is hard to anticipate how users will behave.
Another trick is to assign edvPR.dataView( edvPR.Row) ("Approved" ) to a hidden text box (txtRevApproved) and (more reliably) then wrap your code in an If loop where
If txt.RevApproved.txt <> ""Â
  execute your code
End If
Rob
________________________________
From: Randy Weber <
rweber@...>
To:
vantage@yahoogroups.com
Sent: Monday, May 18, 2009 11:06:06 AM
Subject: [Vantage] DataView Null value error
I have a form that verifies that the PartRev is approved during order
entry. It works fine for parts that have at least one rev, but if there
are no revs, I get an error on this line:
Dim vAprv As Boolean = edvPR.dataView( edvPR.Row) ("Approved" )
I assume the error is there because there is no PartRev record for this
part. Is there a way to avoid this error without Error Handling?
Randy Weber
From: vantage@yahoogroups .com [mailto:vantage@yahoogroups .com] On Behalf
Of Calvin Dekker
Sent: Monday, May 18, 2009 9:55 AM
To: vantage@yahoogroups .com
Subject: RE: [Vantage] Form Event Wizard
Gene -
Without testing your code for you, I noticed your syntax may have a
typo.
If (args.proposedvalue , OrderQty) > 0 Then OrderQty. *
NetWeight
You're referencing OrderQty.
Might want to try OrderQty * NetWeight
Looks like you have an extra dot in your syntax.
Without seeing the trace on this customization, you may want to alter
your code so that you're
always updating your total weight with the new value for the OrderQty as
follows:
IF (args.proposedvalue , OrderQty) > 0 THEN (args.proposedvalue ,
OrderQty) * NetWeight
HTH,
CodaBears, Inc.
Calvin Dekker
From: vantage@yahoogroups .com <mailto:vantage% 40yahoogroups. com>
[mailto:vantage@yahoogroups .com <mailto:vantage% 40yahoogroups. com> ] On
Behalf
Of gmack110256
Sent: Monday, May 18, 2009 6:30 AM
To: vantage@yahoogroups .com <mailto:vantage% 40yahoogroups. com>
Subject: [Vantage] Form Event Wizard
I have set up a numeric box on the SalesOrder form which brings in the
Net.Weight for the selected part on the sales line. I am trying to get
another numeric box to show the total weight of the line by multiplying
the Order.Qty * the Net.Weight. Below is the Code I am using on the Form
Event Wizard.
Private Sub OrderDtl_AfterField Change(ByVal sender As object, ByVal args
As DataColumnChangeEve ntArgs) Handles OrderDtl_Column. ColumnChanged
'// ** Argument Properties and Uses **
'// args.Row("[FieldNam e]")
'// args.Column, args.ProposedValue, args.Row
'
'Add Event Handler Code
'
Select Case args.Column. ColumnName
Case "OrderQty"
If (args.proposedvalue , OrderQty) > 0 Then OrderQty. * NetWeight
Case Else
End Select
End Sub
When I oepn the Salesorder Form it is giving me a compile error that
states name 'Order.Qty' is not declared. The event wizard is set up with
After Field Change, OrderDtl, Order.Qty in the 3 Drop downs on the event
wizard form.
Can anyone tell me What I am missing in the setup to make this work?
Thank You
Gene Mack
Johnson Systems
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]